Permalink
Browse files

action_caching on the home page

  • Loading branch information...
1 parent c50f5ae commit 7176a1a348c8c388deabb95a746b7dcbb52754ad @chrisftw chrisftw committed Mar 2, 2012
Showing with 3 additions and 0 deletions.
  1. +2 −0 pages/app/controllers/refinery/pages_controller.rb
  2. +1 −0 pages/app/sweepers/page_sweeper.rb
@@ -6,6 +6,8 @@ class PagesController < ::ApplicationController
caches_action( :show, :if => Proc.new{ |c| c.params[:path] || c.params[:id] },
:cache_path => Proc.new{ |c| Refinery::Page.cache_key_for(c.params) })
+ caches_action( :home, :cache_path => "pages/home")
+
# Save whole Page after delivery
#after_filter { |c| c.write_cache? }
@@ -13,6 +13,7 @@ def after_destroy(page)
protected
def expire_action_cache(page)
expire_fragment(Refinery::Page.cache_key_for(page.nested_path))
+ expire_fragment("pages/home") if page.nested_path == "/home"
end
end
end

0 comments on commit 7176a1a

Please sign in to comment.