diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-20 17:18:59 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-20 17:18:59 +0000 |
commit | e4f07888ceca3c2ac11818a45cc3374537737e8e (patch) | |
tree | b7431ec26eb3087cc17439026586e0664549a3d7 /actionpack/lib/action_controller/caching.rb | |
parent | 69d0f50206bcca5d6b7d9c491637509af434651c (diff) | |
download | rails-e4f07888ceca3c2ac11818a45cc3374537737e8e.tar.gz rails-e4f07888ceca3c2ac11818a45cc3374537737e8e.tar.bz2 rails-e4f07888ceca3c2ac11818a45cc3374537737e8e.zip |
Made caching work for WEBrick and lighttpd by appending .html for all URLs not already containing a dot
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@715 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/caching.rb')
-rw-r--r-- | actionpack/lib/action_controller/caching.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb index 996b5af08d..98dd9c9df6 100644 --- a/actionpack/lib/action_controller/caching.rb +++ b/actionpack/lib/action_controller/caching.rb @@ -90,11 +90,7 @@ module ActionController #:nodoc: private def page_cache_path(path) - if path[-1,1] == '/' - page_cache_directory + path + '/index' - else - page_cache_directory + path - end + page_cache_directory + path + ".html" end end @@ -115,13 +111,14 @@ module ActionController #:nodoc: # If no options are provided, the current +options+ for this action is used. Example: # cache_page "I'm the cached content", :controller => "lists", :action => "show" def cache_page(content = nil, options = {}) + logger.info "Cached page: #{options.inspect} || #{caching_allowed}" return unless perform_caching && caching_allowed self.class.cache_page(content || @response.body, url_for(options.merge({ :only_path => true }))) end private def caching_allowed - !@request.post? && (@request.parameters.reject { |k, v| %w( id action controller ).include?(k) }).empty? + !@request.post? end end |