Changeset 8415 for branches/2-1-caching/actionpack
- Timestamp:
- 12/16/07 16:56:42 (9 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2-1-caching/actionpack/lib/action_controller/caching.rb
r8414 r8415 57 57 def cache(key, options = nil, &block) 58 58 if cache_configured? 59 cache_store.fetch( key.to_param, options, &block)59 cache_store.fetch(ActiveSupport::Cache.expand_cache_key(key, :controller), options, &block) 60 60 else 61 61 yield … … 64 64 65 65 66 private 66 private 67 67 def cache_configured? 68 68 self.class.cache_configured? branches/2-1-caching/actionpack/lib/action_controller/caching/fragments.rb
r8414 r8415 58 58 # value of url_for on that hash (without the protocol). 59 59 def fragment_cache_key(key) 60 key.is_a?(Hash) ? url_for(key).split("://").last : key.to_param60 ActiveSupport::Cache.expand_cache_key(key.is_a?(Hash) ? url_for(key).split("://").last : key, :fragments) 61 61 end 62 62 … … 82 82 key = fragment_cache_key(key) 83 83 84 self.class.benchmark "Cached fragment : #{key}" do84 self.class.benchmark "Cached fragment miss: #{key}" do 85 85 cache_store.write(key, content, options) 86 86 end … … 95 95 key = fragment_cache_key(key) 96 96 97 self.class.benchmark " Fragment read: #{key}" do97 self.class.benchmark "Cached fragment hit: #{key}" do 98 98 cache_store.read(key, options) 99 99 end