You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caching works by saving the entire template output to the configured cache_store in your application. Note that caching is currently only available for
Rails but support for other frameworks is planned in a future release.
For Rails, requires action_controller.perform_caching to be set to true in your environment, and for cache to be set to a key (object that responds to cache_key method, array or string).
The cache keyword accepts the same parameters as fragment caching for Rails.
cache@user# calls @user.cache_keycache['kewl',@user]# calls @user.cache_key and prefixes with kewl/cache'lists'# explicit key of 'lists'cache'lists',expires_in: 1.hour
The cache keyword can be used from within the base template or any extended template including partials.
Caching can significantly speed up the rendering of RABL templates in production and is strongly recommended when possible.
You can define your own caching engine by creating an object that responds to fetch(key, cache_options, &block) and setting the configuration option (see the default engine)