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

Posted by Thomas Weidner (thomas) on 2007-10-15T13:41:40.000+0000

Assigned to Fabien

Posted by Fabien MARTY (fab) on 2008-08-29T13:00:59.000+0000

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

can you have a look ?

Posted by Fabien MARTY (fab) on 2008-09-27T03:08:57.000+0000

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