Forum: Ruby on Rails Help with caching (caches_page) in Rails 3

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1ac1bdc800919b45b1002b05254d3a68?d=identicon&s=25 leandro moreira (dreampeppers99)
on 2012-10-31 23:15
(Received via mailing list)
I code this on my controller:

 caches_page :index
 cache_sweeper :site_sweeper

https://github.com/leandromoreira/playground.activ...

and this on my sweeper

class SiteSweeper < ActionController::Caching::Sweeper
    observe Article, Category

    def after_create(model)
      expire_cache_for(model)
    end

    def after_update(model)
      expire_cache_for(model)
    end

    def after_destroy(model)
      expire_cache_for(model)
    end

    private
    def expire_cache_for(model)
      expire_page controller: 'page', action: 'index'
    end
end

https://github.com/leandromoreira/playground.activ...

But I change my Article and the change do not expire the page, am I
doing something wrong?
This topic is locked and can not be replied to.