Filed under: cache

Avoiding the dogpile effect

When using caching to speed up webpages (or other request-response oriented protocols), it is very common to tie the update of the cache to a new request, meaning that every request checks if the cache is too old first. If not, it returns the value from the cache. If it is, it tries to recompute the value, after which it is stored in the cache and returned to the client.

Two advantages of this approach are that first it doesn't require other, special scripts to run on the server, and second of all, if the value is not needed, it's not recalculated.

 

1 of 1
Posterous theme by Cory Watilo