Module: Cms::Caching

Includes:
DefaultCaches
Included in:
Cache
Defined in:
lib/cms/caching.rb

Instance Method Summary collapse

Methods included from DefaultCaches

#cms_cache_directory, #mobile_cache_directory

Instance Method Details

#caching_enabled?Boolean

Determine if page caching in enabled.

Returns:

  • (Boolean)


23
24
25
# File 'lib/cms/caching.rb', line 23

def caching_enabled?
  ActionController::Base.perform_caching
end

#flushObject

Flushes page cache if caching has been enabled.



28
29
30
31
32
# File 'lib/cms/caching.rb', line 28

def flush
  if caching_enabled?
    flush_caches
  end
end