Class: TrustyCms::PageResponseCacheDirector
- Inherits:
-
Object
- Object
- TrustyCms::PageResponseCacheDirector
- Defined in:
- app/models/trusty_cms/page_response_cache_director.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(page, listener) ⇒ PageResponseCacheDirector
constructor
A new instance of PageResponseCacheDirector.
- #set_cache_control ⇒ Object
Constructor Details
#initialize(page, listener) ⇒ PageResponseCacheDirector
Returns a new instance of PageResponseCacheDirector.
3 4 5 6 |
# File 'app/models/trusty_cms/page_response_cache_director.rb', line 3 def initialize(page, listener) @page = page @listener = listener end |
Class Method Details
.cache_timeout ⇒ Object
13 14 15 |
# File 'app/models/trusty_cms/page_response_cache_director.rb', line 13 def cache_timeout @cache_timeout ||= 5.minutes end |
.cache_timeout=(val) ⇒ Object
17 18 19 |
# File 'app/models/trusty_cms/page_response_cache_director.rb', line 17 def cache_timeout=(val) @cache_timeout = val end |
Instance Method Details
#set_cache_control ⇒ Object
8 9 10 |
# File 'app/models/trusty_cms/page_response_cache_director.rb', line 8 def set_cache_control cacheable? ? cacheable_response : non_cacheable_response end |