]> granicus.if.org Git - apache/commit
Merge r1591328, r1594643, r1594648 from trunk:
authorJim Jagielski <jim@apache.org>
Fri, 30 May 2014 13:50:37 +0000 (13:50 +0000)
committerJim Jagielski <jim@apache.org>
Fri, 30 May 2014 13:50:37 +0000 (13:50 +0000)
commite7a1b5c4b578cf213820e3cfe0b78aab5859a32d
tree483ecb2c37459e34f2b91119e590185af712a2ce
parent7f76301506bc50bf157144ec9be90e7a660b55bc
Merge r1591328, r1594643, r1594648 from trunk:

mod_cache: Preserve non-cacheable headers forwarded from an origin 304
           response. PR 55547.

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.

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, or CacheIgnoreHeaders is used.

mod_cache: follow up to r1591328.

Define the cache_merge_headers_out() function to merge r->err_headers_out into
r->headers_out and add the ones from r->content_type/encoding if available.
Use it in ap_cache_cacheable_headers_out() where the same is done and in
cache_save_filter() where this has to be done before updating the entry.

mod_cache: follow up to r1594643.

Avoid table lookup if not necessary (fast path first).

Submitted by: ylavic
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1598604 13f79535-47bb-0310-9956-ffa450edef68
STATUS
modules/cache/cache_util.c
modules/cache/cache_util.h
modules/cache/mod_cache.c