instiki/app/controllers/cache_sweeping_helper.rb

29 lines
1.1 KiB
Ruby
Raw Normal View History

2007-01-22 14:43:50 +01:00
module CacheSweepingHelper
def expire_cached_page(web, page_name)
expire_action :controller => 'wiki', :web => web.address,
:action => %w(show published s5 tex print), :id => page_name
2007-01-22 14:43:50 +01:00
expire_action :controller => 'wiki', :web => web.address,
:action => %w(show published), :id => page_name, :mode => 'diff'
end
def expire_cached_summary_pages(web)
categories = WikiReference.find(:all, :conditions => "link_type = 'C'")
%w(recently_revised list).each do |action|
expire_action :controller => 'wiki', :web => web.address, :action => action
categories.each do |category|
expire_action :controller => 'wiki', :web => web.address, :action => action, :category => category.referenced_name
end
end
%w(authors atom_with_content atom_with_headlines file_list).each do |action|
expire_action :controller => 'wiki', :web => web.address, :action => action
end
%w(file_name created_at).each do |sort_order|
expire_action :controller => 'wiki', :web => web.address, :action => 'file_list', :sort_order => sort_order
end
2007-01-22 14:43:50 +01:00
end
end