Permalink
Browse files

Dont ask for no caching if we have a etag to base that decision on

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6166 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
dhh committed Feb 19, 2007
1 parent 7ec0204 commit 372db1cd9e96dfe19217c2cc57b1406564dc16d8
Showing with 1 addition and 0 deletions.
  1. +1 −0 actionpack/lib/action_controller/response.rb
@@ -45,6 +45,7 @@ def prepare!
def handle_conditional_get!
if body.is_a?(String) && headers['Status'][0..2] == '200' && !body.empty?
self.headers['Etag'] ||= %("#{Digest::MD5.hexdigest(body)}")
+ headers.delete('Cache-Control') if headers['Cache-Control'] == DEFAULT_HEADERS['Cache-Control']
if request.headers['HTTP_IF_NONE_MATCH'] == headers['Etag']
self.headers['Status'] = '304 Not Modified'

0 comments on commit 372db1c

Please sign in to comment.