Class: TrustyCms::PageResponseCacheDirector

Inherits:
Object
  • Object
show all
Defined in:
app/models/trusty_cms/page_response_cache_director.rb

Class Method Summary collapse

Instance Method Summary collapse

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_timeoutObject



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_controlObject



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