diff options
author | Xavier Noria <fxn@hashref.com> | 2011-07-05 01:42:13 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-07-05 01:42:13 +0200 |
commit | 289b5253ce476410ff78a5f55248c5a4e6a60223 (patch) | |
tree | 3bf8b5a29c24a0e1afe27e1e3a446459adbf27b5 /actionpack/lib/action_controller/caching/pages.rb | |
parent | 892c99ca5cfc8b9ea1a06066f23bec847838f7f8 (diff) | |
parent | 254a1e57d79143f21af74e1aa289ba546b3be821 (diff) | |
download | rails-289b5253ce476410ff78a5f55248c5a4e6a60223.tar.gz rails-289b5253ce476410ff78a5f55248c5a4e6a60223.tar.bz2 rails-289b5253ce476410ff78a5f55248c5a4e6a60223.zip |
Merge branch 'master' of git://github.com/lifo/docrails
Diffstat (limited to 'actionpack/lib/action_controller/caching/pages.rb')
-rw-r--r-- | actionpack/lib/action_controller/caching/pages.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/caching/pages.rb b/actionpack/lib/action_controller/caching/pages.rb index 8c583c7ce0..496390402b 100644 --- a/actionpack/lib/action_controller/caching/pages.rb +++ b/actionpack/lib/action_controller/caching/pages.rb @@ -16,9 +16,10 @@ module ActionController #:nodoc: # caches_page :show, :new # end # - # This will generate cache files such as <tt>weblog/show/5.html</tt> and <tt>weblog/new.html</tt>, - # which match the URLs used to trigger the dynamic generation. This is how the web server is able - # pick up a cache file when it exists and otherwise let the request pass on to Action Pack to generate it. + # This will generate cache files such as <tt>weblog/show/5.html</tt> and <tt>weblog/new.html</tt>, which match the URLs used + # that would normally trigger dynamic page generation. Page caching works by configuring a web server to first check for the + # existence of files on disk, and to serve them directly when found, without passing the request through to Action Pack. + # This is much faster than handling the full dynamic request in the usual way. # # Expiration of the cache is handled by deleting the cached file, which results in a lazy regeneration approach where the cache # is not restored before another hit is made against it. The API for doing so mimics the options from +url_for+ and friends: @@ -132,8 +133,8 @@ module ActionController #:nodoc: end end - # Manually cache the +content+ in the key determined by +options+. If no content is provided, the contents of response.body is used - # If no options are provided, the requested url is used. Example: + # Manually cache the +content+ in the key determined by +options+. If no content is provided, the contents of response.body is used. + # If no options are provided, the url of the current request being handled is used. Example: # cache_page "I'm the cached content", :controller => "lists", :action => "show" def cache_page(content = nil, options = nil) return unless self.class.perform_caching && caching_allowed? |