clears cache on rebuild, returns int