Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

action_caching on the home page

  • Loading branch information...
commit 7176a1a348c8c388deabb95a746b7dcbb52754ad 1 parent c50f5ae
@chrisftw chrisftw authored
View
2  pages/app/controllers/refinery/pages_controller.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? }
View
1  pages/app/sweepers/page_sweeper.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.