Skip to content
Joshua Nussbaum edited this page Jan 24, 2015 · 1 revision

Caching Templates

By default templates are fetched on-demand. Templates in app/assets/templates/layout are cached in the first html response for increased speed. You can add additional templates to be pre-cached, by setting config.cached_paths. Example:

# config/initializers/sprangular.rb
Sprangular::Engine.config.cached_paths += %w(products)

Caching Data

To cache API responses, configure cache_store in your config/environments/production.rb

config.action_controller.perform_caching = true
config.cache_store = :memory_store # or :dalli_store, :mem_cache_store

Clone this wiki locally