Disadvantages to rack-cache vs. Varnish in Heroku cedar stack?

前端 未结 4 1885
旧时难觅i
旧时难觅i 2021-02-01 05:37

The previous 2 Heroku application stacks came with a Varnish layer which automatically reverse-proxy-cached content based on http headers.

The new Heroku cedar stack doe

4条回答
  •  温柔的废话
    2021-02-01 06:07

    A more modern answer, with 20/20 hindsight:

    To get the caching performance approaching that of bamboo on cedar-14, this is the usual pattern:

    1. Configure Rails to generate appropriate caching headers (i.e., Etags, Cache-Control, Last-Modified, etc.)
    2. Stick fastly (varnish as a service) or cloudflare in front of your app. If app headers were set correctly, profile-like pages that need to be fresh won't be cached, as opposed to static assets.

    I would recommend redis-rails as a rack cache backend, if you're doing caching at multiple layers (FE (CF/FY), page, action, fragment, etc.).

提交回复
热议问题