We are currently updating our sites at work, and I am responsible for selecting / developing our caching strategy.
Our sites are all article-based sites, but some of them have a user-defined system for articles with limited access that need subscriptions.
So far, we have used page caching (and saved pages in memcached) with a bit of javascript. However, Im thinks that Rack :: Cache or perhaps Varnish is the best solution. As far as I can see, it works almost the same as in terms of performance:
- Page caching, caches the full page in memcached, and this cache will be served directly from memcached by nginx in a future request.
- Rack :: Cache also caches the full page in memcached, while the cached version is served by the web server instead of nginx. Rack :: Cache uses HTTP caching headers, which means that visitors will also store the local cache in browsers. In addition, it would be easy to replace varnish that also uses HTTP caching headers.
I'm right so far, and does anyone else have some comments on the differences or effectiveness of the two strategies? It is also possible to use both, but I see some advantages of this approach, as they will cache the same page types.
source share