Padrino::Cache::Helpers::Fragment
Module: Padrino::Cache::Helpers::Fragment
- Includes:
- Helpers::OutputHelpers
Overview
Whereas page-level caching, described in the first section of this document, works by grabbing the entire output of a route, fragment caching gives the developer fine-grained control of what gets cached. This type of caching occurs at whatever level you choose.
Possible uses for fragment caching might include:
-
a 'feed' of some items on a page
-
output fetched (by proxy) from an API on a third-party site
-
parts of your page which are largely static/do not need re-rendering every request
-
any output which is expensive to render
Instance Method Summary
-
#cache(key, opts = {}, &block) ⇒ Object
This helper is used anywhere in your application you would like to associate a fragment to be cached.
Methods included from Helpers::OutputHelpers
#block_is_template?, #capture_html, #concat_content, #concat_safe_content, #content_for, #content_for?, handlers, register, #yield_content
Instance Method Details
#cache(key, opts = {}, &block) ⇒ Object
This helper is used anywhere in your application you would like to associate a fragment to be cached. It can be used in within a route:
© 2010–2016 Padrino
Licensed under the MIT License.
http://www.rubydoc.info/github/padrino/padrino-framework/Padrino/Cache/Helpers/Fragment