Module: Padrino::Cache::Helpers::Page
Overview
Page caching is easy to integrate into your application. To turn it on, simply provide the :cache => true
option on either a controller or one of its routes. By default, cached content is persisted with a “file store” –that is, in a subdirectory of your application root.
You can manually expire cache with CachedApp.cache.delete(:my_name)
Note that the “latest” method call to expires
determines its value: if called within a route, as opposed to a controller definition, the route's value will be assumed.
Defined Under Namespace
Modules: ClassMethods
Constant Summary collapse
- CACHED_VERBS =
{ 'GET' => true, 'HEAD' => true }.freeze
Class Method Summary
Instance Method Summary
-
#cache_key(name = nil, &block) ⇒ Object
This helper is used within a route or route to indicate the name in the cache. -
#expires(time) ⇒ Object
This helper is used within a controller or route to indicate how often content should persist in the cache.
Class Method Details
.padrino_route_added(route, verb) ⇒ Object
Instance Method Details
#cache_key(name = nil, &block) ⇒ Object
This helper is used within a route or route to indicate the name in the cache.
end
#expires(time) ⇒ Object
This helper is used within a controller or route to indicate how often content should persist in the cache.
After seconds
seconds have passed, content previously cached will be discarded and re-rendered. Code associated with that route will not be executed; rather, its previous output will be sent to the client with a 200 OK status code.
© 2010–2020 Padrino
Licensed under the MIT License.
https://www.rubydoc.info/github/padrino/padrino-framework/Padrino/Cache/Helpers/Page