-
Notifications
You must be signed in to change notification settings - Fork 23
Caching
Joshua Nussbaum edited this page Jan 24, 2015
·
1 revision
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)
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