Permalink
Browse files

Removed page caching on posts, and the associated sweeper

  • Loading branch information...
1 parent 8385eac commit 261a3601b9de03a9622d9b0f406b310b3a804a6e @mrGrazy mrGrazy committed with ugisozols Jul 30, 2012
@@ -3,8 +3,6 @@ module Blog
module Admin
class CommentsController < ::Refinery::AdminController
- cache_sweeper Refinery::BlogSweeper
-
crudify :'refinery/blog/comment',
:title_attribute => :name,
:order => 'published_at DESC'
@@ -3,8 +3,6 @@ module Blog
module Admin
class PostsController < ::Refinery::AdminController
- cache_sweeper Refinery::BlogSweeper
-
crudify :'refinery/blog/post',
:order => 'published_at DESC',
:include => [:translations]
@@ -2,8 +2,6 @@ module Refinery
module Blog
class PostsController < BlogController
- caches_page :index, :unless => proc {|c| c.refinery_user_signed_in? || c.flash.any? || params[:page].present? }
-
before_filter :find_all_blog_posts, :except => [:archive]
before_filter :find_blog_post, :only => [:show, :comment, :update_nav]
before_filter :find_tags
@@ -1,26 +0,0 @@
-module Refinery
- class BlogSweeper < ActionController::Caching::Sweeper
- observe Blog::Post, Blog::Comment
-
- def after_create(record)
- expire_cache_for(record)
- end
-
- def after_update(record)
- expire_cache_for(record)
- end
-
- def after_destroy(record)
- expire_cache_for(record)
- end
-
- private
-
- def expire_cache_for(record)
- # TODO: Convert these to url helpers
- expire_page '/blog'
- expire_page '/blog/feed.rss'
- end
-
- end
-end

0 comments on commit 261a360

Please sign in to comment.