Detect new assets and cache them

From #6330.