[WIP] Cache regenerated files onto disk

tests are failing and i don't know why