Class: Blogit::BlogitSweeper
- Inherits:
-
ActionController::Caching::Sweeper
- Object
- ActionController::Caching::Sweeper
- Blogit::BlogitSweeper
- Defined in:
- app/sweepers/blogit/blogit_sweeper.rb
Overview
This is a universal cache sweeper. If a comment is added or a blog post is updated, we should remove all the cached pages. This will reduce the risk of dead links from tags clouds etc.
To activate page caching, set config.cache_pages = true in your blogit.rb file
Instance Method Summary (collapse)
Instance Method Details
- (Object) after_save(record)
13 14 15 |
# File 'app/sweepers/blogit/blogit_sweeper.rb', line 13 def after_save(record) clear_cached_pages end |