From 3ac844deec6070f35634acca0ae9007280b13e5d Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Mon, 6 Dec 2010 16:38:47 -0500 Subject: Add to documentation that action caching does handle HTTP_ACCEPT attribute properly and might provide wrong result. Use params[:format] to avoid this issue. --- actionpack/lib/action_controller/caching/actions.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionpack/lib/action_controller/caching') diff --git a/actionpack/lib/action_controller/caching/actions.rb b/actionpack/lib/action_controller/caching/actions.rb index d69d96b974..cb79e51dbf 100644 --- a/actionpack/lib/action_controller/caching/actions.rb +++ b/actionpack/lib/action_controller/caching/actions.rb @@ -71,6 +71,11 @@ module ActionController #:nodoc: # If you pass :layout => false, it will only cache your action # content. It is useful when your layout has dynamic information. # + # Note: If action caching is being performed for different MIME types + # and those MIME types are being determined by HTTP_ACCEPT header atttribute + # and noth using params[:format] then both the cached data and the content-type + # of the response could be wrong. The safest way to use action caching is to + # pass non-html attribute as params[:format] . module Actions extend ActiveSupport::Concern -- cgit v1.2.3