caches_pag eとの違い
caches_act
"/lists"と"/lists.xml "は別々にキャッシュされる
また、http://blo
キャッシュの無効化
expire_act
1 class ListSweeper < ActionCont roller::Ca ching::Swe eper 2 observe List, Item 3 4 def after_save (record) 5 list = record.is_a?(List) ? record : record.list 6 expire_pag e(:controller => "lists", :action => %w( show public feed ), :id => list.id) 7 expire_act ion(:controller => "lists", :action => "all") 8 list.shares.each { |share| expire_pag e(:controller => "lists", :action => "show", :id => share.url_key) } 9 end 10 end 11 12 class ListsContr oller < Applicatio nControlle r 13 caches_act ion :index, :show, :public, :feed 14 cache_swee per :list_sweep er, :only => [ :edit, :destroy, :share ] 15 end
Refs
vendor/rai
http://sco
http://www
http://www
posted by
satoko
on Sat 28 Jun 2008
at 01:19