recomputations can happen. function x-fetch(key, ttl, beta=1) { value, delta, expiry ← cache_read(key) if (!value || (time() - delta * beta * log(rand(0,1))) ≥ expiry) { start ← time() value ← recompute_value() delta ← time() – start cache_write(key, (value, delta), ttl) } return value } The parameter can be set to a value greater than 1 to favor earlier recomputations and further reduce stampedes but the authors show that setting =1 works well in practice. The variable represents the time to recompute the value and is used to scale the probability distribution appropriately. This approach is simple to implement and effectively reduces cache stampedes by automatically favoring early recomputations when the traffic rate increases. One drawback is that it takes more memory in cache as we need to bundle the value delta with the cache item - when the caching system does not support retrieval of the key expiration time, we also need to store the (that is, ) in the bundle. References External links Minimizing cache stampedes, Joshua Thijssen, 2010 Problems and solutions for typical perl cache usage, Jonathan Swartz, 2008 Engineering failures Parallel computing Computer optimization Cache (computing)