Difference between Rack::Cache and page caching

216 views Asked by At

We are currently updating our sites at work, and I am responsible for choosing/designing our caching strategy.

Our sites are all article based magazine sites, however some of them have a user system for restricted articles that needs subscriptions.

We have used page caching so far (and stored the pages in memcached) with a little bit of javascript. However Im thinking that Rack::Cache or maybe Varnish is a better solution now. As far as i can see, does it work almost the same way performance wise:

  • Page caching, caches the full page in memcached and this cache will be served directly from memcached by nginx on future request.
  • Rack::Cache, also caches the full page in memcached, owever the cached version is served by the webserver instead of nginx. Rack::Cache uses HTTP-caching headers which means that visitors also will store a local cache in the browsers. Furthermore would it be easy to replace with Varnish, that also uses HTTP-caching headers.

Im i right so far, and does anyone else have some comments on the differences or the performance of the two strategies? It's also possible too use both, but i can see any advantages with this approach as they will cache the same types of pages.

0

There are 0 answers