Be the first to like this
Rails fragment caching is one of simple tool against performance issue. Using memcache cache store you get a lean and scalable solution to cache part of request.
Memcached support time based cache expiry which reduce down to zero the need for plumbing code for cache sweeping, while providing a decent generic solution to a lot of case.
Yet when volumes is growing and fragment takes time to be generated it tends to create load of peak by synchronizing cache recalculation on multiple process, annihilating cache purposes and killing performance of the whole stack.
The purpose of this talk is to describe the problem and propose an alternative cache store that preserves the simplicity of rails fragment cache mechanism based on time expiry while offering atomic cache invalidation and refreshing.
This presentation was done during and for Paris.rb ruby user group on August '11. This should be considered experimental and open to discussion and improvement.