aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Kampmeier <chris@kampers.net>2008-11-29 18:10:54 -0800
committerChris Kampmeier <chris@kampers.net>2008-11-29 18:10:54 -0800
commitf204e515ae2a4b6cd037b4b64ffae3b1e1a01df3 (patch)
tree8d973a4171f79148ab2d3bbc8289400ec93c3589
parent4812e350b9e96641a29c8db6ea153426dad1c9a2 (diff)
downloadrails-f204e515ae2a4b6cd037b4b64ffae3b1e1a01df3.tar.gz
rails-f204e515ae2a4b6cd037b4b64ffae3b1e1a01df3.tar.bz2
rails-f204e515ae2a4b6cd037b4b64ffae3b1e1a01df3.zip
Fix typo and cleanup docs for #expire_fragment [#1398 state:resolved]
-rw-r--r--actionpack/lib/action_controller/caching/fragments.rb26
1 files changed, 17 insertions, 9 deletions
diff --git a/actionpack/lib/action_controller/caching/fragments.rb b/actionpack/lib/action_controller/caching/fragments.rb
index 31cbe27452..b4ce7f6a3e 100644
--- a/actionpack/lib/action_controller/caching/fragments.rb
+++ b/actionpack/lib/action_controller/caching/fragments.rb
@@ -83,15 +83,23 @@ module ActionController #:nodoc:
end
end
- # Name can take one of three forms:
- # * String: This would normally take the form of a path like "pages/45/notes"
- # * Hash: Is treated as an implicit call to url_for, like { :controller => "pages", :action => "notes", :id => 45 }
- # * Regexp: Will destroy all the matched fragments, example:
- # %r{pages/\d*/notes}
- # Ensure you do not specify start and finish in the regex (^$) because
- # the actual filename matched looks like ./cache/filename/path.cache
- # Regexp expiration is only supported on caches that can iterate over
- # all keys (unlike memcached).
+ # Removes fragments from the cache.
+ #
+ # +key+ can take one of three forms:
+ # * String - This would normally take the form of a path, like
+ # <tt>"pages/45/notes"</tt>.
+ # * Hash - Treated as an implicit call to +url_for+, like
+ # <tt>{:controller => "pages", :action => "notes", :id => 45}</tt>
+ # * Regexp - Will remove any fragment that matches, so
+ # <tt>%r{pages/\d*/notes}</tt> might remove all notes. Make sure you
+ # don't use anchors in the regex (<tt>^</tt> or <tt>$</tt>) because
+ # the actual filename matched looks like
+ # <tt>./cache/filename/path.cache</tt>. Note: Regexp expiration is
+ # only supported on caches that can iterate over all keys (unlike
+ # memcached).
+ #
+ # +options+ is passed through to the cache store's <tt>delete</tt>
+ # method (or <tt>delete_matched</tt>, for Regexp keys.)
def expire_fragment(key, options = nil)
return unless cache_configured?