only cache when preprocessing is ready

Only cache these values if preprocessing is ready. Preprocessing is ready when the
@items attribute is frozen.