mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Dont expire or read fragments if caching is turned off
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1270 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -276,6 +276,8 @@ module ActionController #:nodoc:
|
||||
end
|
||||
|
||||
def write_fragment(name, content, options = {})
|
||||
return unless perform_caching
|
||||
|
||||
key = fragment_cache_key(name)
|
||||
fragment_cache_store.write(key, content, options)
|
||||
logger.info "Cached fragment: #{key}" unless logger.nil?
|
||||
@@ -283,6 +285,8 @@ module ActionController #:nodoc:
|
||||
end
|
||||
|
||||
def read_fragment(name, options = {})
|
||||
return unless perform_caching
|
||||
|
||||
key = fragment_cache_key(name)
|
||||
if cache = fragment_cache_store.read(key, options)
|
||||
logger.info "Fragment hit: #{key}" unless logger.nil?
|
||||
@@ -297,6 +301,8 @@ module ActionController #:nodoc:
|
||||
# * 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}
|
||||
def expire_fragment(name, options = {})
|
||||
return unless perform_caching
|
||||
|
||||
key = fragment_cache_key(name)
|
||||
|
||||
if key.is_a?(Regexp)
|
||||
|
||||
Reference in New Issue
Block a user