Class: ActionController::Caching::Pages::PageCache
- Inherits:
-
Object
- Object
- ActionController::Caching::Pages::PageCache
- Defined in:
- lib/action_controller/caching/pages.rb
Overview
:nodoc:
Instance Method Summary collapse
- #cache(content, path, extension = nil, gzip = Zlib::BEST_COMPRESSION) ⇒ Object
- #expire(path) ⇒ Object
-
#initialize(cache_directory, default_extension, controller = nil) ⇒ PageCache
constructor
A new instance of PageCache.
Constructor Details
#initialize(cache_directory, default_extension, controller = nil) ⇒ PageCache
Returns a new instance of PageCache.
66 67 68 69 70 |
# File 'lib/action_controller/caching/pages.rb', line 66 def initialize(cache_directory, default_extension, controller = nil) @cache_directory = cache_directory @default_extension = default_extension @controller = controller end |
Instance Method Details
#cache(content, path, extension = nil, gzip = Zlib::BEST_COMPRESSION) ⇒ Object
78 79 80 81 82 |
# File 'lib/action_controller/caching/pages.rb', line 78 def cache(content, path, extension = nil, gzip = Zlib::BEST_COMPRESSION) instrument :write_page, path do write(content, cache_path(path, extension), gzip) end end |
#expire(path) ⇒ Object
72 73 74 75 76 |
# File 'lib/action_controller/caching/pages.rb', line 72 def expire(path) instrument :expire_page, path do delete(cache_path(path)) end end |