aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/caching_with_rails.textile
diff options
context:
space:
mode:
Diffstat (limited to 'guides/source/caching_with_rails.textile')
-rw-r--r--guides/source/caching_with_rails.textile4
1 files changed, 3 insertions, 1 deletions
diff --git a/guides/source/caching_with_rails.textile b/guides/source/caching_with_rails.textile
index 9f1ac18814..577596ac0d 100644
--- a/guides/source/caching_with_rails.textile
+++ b/guides/source/caching_with_rails.textile
@@ -173,7 +173,9 @@ expire_fragment('all_available_products')
h4. Sweepers
-Cache sweeping is a mechanism which allows you to get around having a ton of +expire_{page,action,fragment}+ calls in your code. It does this by moving all the work required to expire cached content into an +ActionController::Caching::Sweeper+ subclass. This class is an observer and looks for changes to an object via callbacks, and when a change occurs it expires the caches associated with that object in an around or after filter.
+Cache sweeping is a mechanism which allows you to get around having a ton of +expire_{page,action,fragment}+ calls in your code. It does this by moving all the work required to expire cached content into an +ActionController::Caching::Sweeper+ subclass. This class is an observer and looks for changes to an Active Record object via callbacks, and when a change occurs it expires the caches associated with that object in an around or after filter.
+
+TIP: Sweepers rely on the use of Active Record and Active Record Observers. The object you are observing must be an Active Record model.
Continuing with our Product controller example, we could rewrite it with a sweeper like this: