You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2013/09/11 19:18:25 UTC

[Bug 55547] New: mod_cache strips the non-cacheable headers from an original 304 response (valid stale entry)

https://issues.apache.org/bugzilla/show_bug.cgi?id=55547

            Bug ID: 55547
           Summary: mod_cache strips the non-cacheable headers from an
                    original 304 response (valid stale entry)
           Product: Apache httpd-2
           Version: 2.5-HEAD
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_cache
          Assignee: bugs@httpd.apache.org
          Reporter: ylavic.dev@gmail.com

Created attachment 30817
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30817&action=edit
Don't strip the non-cacheable headers from a validated 304 response

When mod_cache asks for a revalidation of a stale entry and the origin responds
with a 304 (not that stale), the module strips the non-cacheable headers from
the origin response and merges the stale headers to update the cache (before
store_headers).

The problem is that mod_cache won't forward the non-cacheable headers to the
client, for example if the 304 response contains both Set-Cookie and
'Cache-Control: no-cache="Set-Cookie"' headers.

The issue was already stated in bug 54706, comment 3, although not related to
the changes made there (before the Cache-Control no-cache=/no-store= handling,
the bug could arise using the CacheIgnoreHeaders directive, and still can),
hence the comment was not taken into account.

I also proposed to compute the cacheable headers once in bug 54706, comment 9,
and fix this issue together by maintaining the cacheable/response headers
separatly, but this is surely an overkill patch (reintroducing the
request_config in mod_cache to preserve the API) for the only purpose of this
issue.

Finally a simple patch can do the job, and is attached here.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55547] mod_cache strips the non-cacheable headers from a response 304 (Not That Stale)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55547

macbogucki@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |macbogucki@gmail.com

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55547] mod_cache strips the non-cacheable headers from a response 304 (Not That Stale)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55547

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2.5-HEAD                    |2.4-HEAD

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55547] mod_cache strips the non-cacheable headers from a response 304 (Not That Stale)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55547

--- Comment #3 from Yann Ylavic <yl...@gmail.com> ---
> Currently the Set-Cookie of a 304 response from the origin server is stripped.
Only with Cache-Control: no-cache="Set-Cookie" or alike, of course.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55547] mod_cache strips the non-cacheable headers from a response 304 (Not That Stale)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55547

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|mod_cache strips the        |mod_cache strips the
                   |non-cacheable headers from  |non-cacheable headers from
                   |an original 304 response    |a response 304 (Not That
                   |(valid stale entry)         |Stale)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55547] mod_cache strips the non-cacheable headers from a response 304 (Not That Stale)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55547

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ylavic.dev@gmail.com

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55547] mod_cache strips the non-cacheable headers from a response 304 (Not That Stale)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55547

--- Comment #2 from Yann Ylavic <yl...@gmail.com> ---
Any news here ?

Currently the Set-Cookie of a 304 response from the origin server is stripped.

Regards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55547] mod_cache strips the non-cacheable headers from a response 304 (Not That Stale)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55547

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55547] mod_cache strips the non-cacheable headers from a response 304 (Not That Stale)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55547

Christophe JAILLET <ch...@wanadoo.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Christophe JAILLET <ch...@wanadoo.fr> ---
Fixed and released in 2.4.10

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55547] mod_cache strips the non-cacheable headers from a response 304 (Not That Stale)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55547

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #30817|0                           |1
        is obsolete|                            |

--- Comment #1 from Yann Ylavic <yl...@gmail.com> ---
Created attachment 30823
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30823&action=edit
Fix headers forwarded from/as an origin 304 response

In the same case, when the conditional request meets the conditions of the
stale then revalidated entry, the forwarded 304 response includes the entity
headers merged from the cached headers before updating the entry.

This new patch does the same as the previous one but also stips the spurious
entity headers on forwarded 304 responses.

Note that since the entity headers are stripped elsewhere (line 1167, about 304
response as well and sections 10.3.3/10.3.5 of the RFC2616), the code has been
moved to a function; and the missing headers "Expires" and "Content-Location"
added to the list (the same list in server/protocol.c line 1225 includes them,
should it not be an ap_ function to do that?).

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55547] mod_cache strips the non-cacheable headers from a response 304 (Not That Stale)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55547

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|PatchAvailable              |FixedInTrunk

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org