1. A computer program product embodied on tangible storage media, the computer program product comprising instructions operable to cause data processing apparatus to: store a first item in a cache with an indication of a process to generate the first item; schedule a validity period for the first item, wherein: the validity period is optimized to be less than a period of time after which the first item would be promoted from a first generation of the cache to a second generation of the cache, invalid objects in the first generation of the cache are freed from memory more frequently than invalid objects in the second generation of the cache; track a number of accesses to the first item in the cache; and purge the first item from the cache when the validity period has expired and a number of accesses to the first item is below a threshold number.