Module: Catche::Expire::Pages

Defined in:
lib/catche/expire/pages.rb

Class Method Summary collapse

Class Method Details

.expire!(*paths) ⇒ Object

Expires cache by deleting the associated files Uses the same flow as defined in ‘expire_page` in ActionController

Catche::Expire::Page.expire!('/public/projects.html')


11
12
13
14
15
16
# File 'lib/catche/expire/pages.rb', line 11

def expire!(*paths)
  paths.each do |path|
    File.delete(path) if File.exist?(path)
    File.delete(path + '.gz') if File.exist?(path + '.gz')
  end
end