ZF-2069: Cache Atrophy

Description

It would be good to be able to allow cache "atrophy". There are two different forms of atrophy that could be available based on data changes:

a) A minimum and maximum cache expiry are set (say 5 mins, 30 mins), at first the expiry is at the minimum (5 mins), if the data has not changed at the end of the expiry period, the expiry period then increases by the atrophy rate (say 20%) so it is then longer (6 mins). This continues until the maximum expiry period. If the data has changed at an expiry point, the expiry period is reset to the minimum (5 mins) or possibly decreases and the process starts again. This attempts to spend less time refreshing cache that does not change often.

b) A minimum and maximum cache expiry are set (say 5 mins, 30 mins), at first the expiry is at the maximum (30mins), if the data has changed at the end of the expiry period, the expiry period then decreases by the atrophy rate (say 20%) so it is then shorter (24 mins). This continues until the minimum expiry period. If the data has not changed at an expiry point, the expiry period is reset to the maxmimum (30 mins) or possibly increases and the process starts again. This attempts to keep changing data fresher.

There is also another approach based on traffic:

c) Minimum and maximum expiries are set as above, along with traffic levels and an atrophy level. As an item becomes more and more popular the cache expiry gets shorter and shorter to ensure the data is as up-to-date as possible.

d) Same as "c" except the cache expiry is set longer and longer as the item gets more popular. This means the load is being reduced by caching more and more when items are popular, however they become more and more out-of-date.

Comments

Assigned to Fabien

something like this is done (just now in SVN trunk) by the TwoLevels backend

can you have a look ?

something like this is done (just now in SVN trunk) by the TwoLevels backend

can you have a look ?

probably fixed by the TwoLevels new backend (no news)

Changing issues in preparation for the 1.7.0 release.