3 ms·
I recently wrote a blog post about how Rack::Cache and ETag work http://blog.craz8.com/articles/2012/12/19/rack-cache-and-etags-for-even-faster-rails http://blo
by tomfakes 14y ago
I recently wrote a blog post about how Rack::Cache and ETag work http://blog.craz8.com/articles/2012/12/19/rack-cache-and-etags-for-even-faster-rails http://blog.craz8.com/articles/2012/12/19/rack-cache-and-eta..., which is particularly important to know for Heroku based apps.
The key part is that, for public content (and blog posts tend to be public), the Rack Cache can be used to serve these pages directly from the cache store (usually Memcache) with minor database traffic needed, even for people who have never seen this content.
That last part was the surprise for me - surely ETags are only used by return visitors! Rack Cache makes ETags work for new visitors too.
I think I can get my blog to run almost as fast as a static site, and I'm working towards getting that done and documenting it as I go.
(In addition, Heroku seems to be adding Varnish headers to my responses. They say they don't use Varnish in Cedar apps, but this is clearly not correct)