Skip to content
Browse files

Add to documentation that action caching does

handle HTTP_ACCEPT attribute properly and might
provide wrong result. Use params[:format] to
avoid this issue.
  • Loading branch information...
1 parent 13a7302 commit ee6b45acb3d0d9d87d1cfd07c9daf54675ef9be6 Neeraj Singh committed with fxn Dec 6, 2010
Showing with 5 additions and 0 deletions.
  1. +5 −0 actionpack/lib/action_controller/caching/actions.rb
5 actionpack/lib/action_controller/caching/actions.rb
@@ -71,6 +71,11 @@ module Caching
# 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

0 comments on commit ee6b45a

Please sign in to comment.
Something went wrong with that request. Please try again.