All major content, browse, and search pages are cached for a short and configurable duration by an HTTP cache. This allows the system to serve a large number of requests in a short period of time.
module Workarea class Storefront::PagesController < Storefront::ApplicationController before_filter :cache_page # ... end end
Controller/actions which enable this include:
Customizing the Rack::Cache Key
There are scenarios where it becomes necessary to vary
Rack::Cache entries, like geolocated content blocks or segmentation-based navigation. In these cases, Workarea provides a relatively straight-forward way to add to the cache key. Refer to the documentation in the code for Workarea::Cache::Varies for more information.
Workarea::Cache::Varies can have a very adverse affect on application performance, and is not encouraged. Make sure this is what you need, and feel free to reach out on Slack to see if there may be a better way to achieve your goals.
Resources on HTTP Caching
How'd We Do?
If you found this article was missing information or wasn't quite what you were looking for, we are open to any suggestions or feedback on what we could do better.Help Us Out