1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-14 01:22:37 +03:00
Commit Graph

158 Commits

Author SHA1 Message Date
Rainer Jung
7dd1f3d0c3 Fix typo in comment.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1620461 13f79535-47bb-0310-9956-ffa450edef68
2014-08-25 21:32:43 +00:00
Eric Covener
31fffa60f9 don't let handlers start with r->status = 304 during a failed revalidation
PR56881



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1619835 13f79535-47bb-0310-9956-ffa450edef68
2014-08-22 15:26:27 +00:00
Yann Ylavic
baf4f92af0 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1594643 13f79535-47bb-0310-9956-ffa450edef68
2014-05-14 17:11:49 +00:00
Yann Ylavic
308f0615fd mod_cache: follow up to r1591390
Fix code typo.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591394 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 16:53:00 +00:00
Yann Ylavic
f33d682667 mod_cache: follow up to r1591322
Avoid one unnecessary test when checking 304 contradictions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591390 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 16:34:15 +00:00
Yann Ylavic
4d2d2c5edc 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591328 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 14:58:33 +00:00
Yann Ylavic
0e28401e45 mod_cache: follow up to r1591320.
Use the new MOD_CACHE_ENTITY_HEADERS[] names to check 304 contradictions
against the same headers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591322 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 14:53:35 +00:00
Yann Ylavic
75e24df9a8 mod_cache: Don't add cached/revalidated entity headers to a 304 response.
PR 55547.

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).
Strip them before returning a 304.

Since the entity headers are stripped elsewhere, factorize the code using a
new table (MOD_CACHE_ENTITY_HEADERS[]) containing these headers's names.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591320 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 14:43:27 +00:00
Yann Ylavic
241c1c3d0e Revert r1591312 (again) to commit the 2 fixes separately.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591316 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 14:33:21 +00:00
Yann Ylavic
676b474db1 mod_cache: Don't add cached/revalidated entity headers to a 304 response.
PR 55547.

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).
Strip them before returning a 304.

Since the entity headers are stripped elsewhere, factorize the code using a
new table (MOD_CACHE_ENTITY_HEADERS[]) containing these headers's names.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591312 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 14:25:45 +00:00
Yann Ylavic
e14c0e4755 mod_cache: Retry unconditional request with the full URL (including the
query-string) when the origin server's 304 response does not
           match the conditions used to revalidate the stale entry.

http://www.mail-archive.com/dev@httpd.apache.org/msg59884.html


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591143 13f79535-47bb-0310-9956-ffa450edef68
2014-04-29 23:28:11 +00:00
Christophe Jaillet
ebcf0f34d2 Fix layout
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1586827 13f79535-47bb-0310-9956-ffa450edef68
2014-04-12 07:57:44 +00:00
Eric Covener
43fbd8b76b leave a warning about cc_out
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1584429 13f79535-47bb-0310-9956-ffa450edef68
2014-04-03 22:19:23 +00:00
Eric Covener
b826c7cadd add the URI to DEBUG message 00765 (and drop an exclamation point):
Cache provider's store_body failed!



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1563193 13f79535-47bb-0310-9956-ffa450edef68
2014-01-31 17:40:54 +00:00
Eric Covener
397bdd8c43 Expires in a 304 is not a contradiction in terms of r1487118:
- Expires, Cache-Control, and/or Vary, if the field-value might
        differ from that sent in any previous response for the same
        variant




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1518269 13f79535-47bb-0310-9956-ffa450edef68
2013-08-28 16:07:50 +00:00
Eric Covener
39ebf1bf09 reflow a very long line, no functional change
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1502665 13f79535-47bb-0310-9956-ffa450edef68
2013-07-12 19:33:19 +00:00
Eric Covener
80475f6ca2 fix whitespace in AH00766 warning:
s/all of theinput/all of the input/



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1501423 13f79535-47bb-0310-9956-ffa450edef68
2013-07-09 18:21:43 +00:00
Stefan Fritsch
ca2948ea2d update log tags
replace duplicate, add missing


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1481396 13f79535-47bb-0310-9956-ffa450edef68
2013-05-11 19:45:09 +00:00
Graham Leggett
a6d1be91ef mod_cache: If a 304 response indicates an entity not currently cached, then
the cache MUST disregard the response and repeat the request without the 
conditional.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1481197 13f79535-47bb-0310-9956-ffa450edef68
2013-05-10 21:40:54 +00:00
Graham Leggett
5c93801e65 Ensure that Warning headers are correctly handled as per RFC2616.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1480283 13f79535-47bb-0310-9956-ffa450edef68
2013-05-08 14:06:48 +00:00
Graham Leggett
e225273e6a mod_cache: Ensure that we don't attempt to replace a cached response
with an older response as per RFC2616 13.12.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479966 13f79535-47bb-0310-9956-ffa450edef68
2013-05-07 16:16:16 +00:00
Graham Leggett
6194962c46 core, mod_cache: Ensure RFC2616 compliance in ap_meets_conditions()
with weak validation combined with If-Range and Range headers. Break
out explicit conditional header checks to be useable elsewhere in the
server. Ensure weak validation RFC compliance in the byteranges filter.
Ensure RFC validation compliance when serving cached entities. PR 16142


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479905 13f79535-47bb-0310-9956-ffa450edef68
2013-05-07 13:42:31 +00:00
Graham Leggett
e362111d24 mod_cache: Ensure that updated responses to HEAD requests don't get
mistakenly paired with a previously cached body. Ensure that any existing
body is removed when a HEAD request is cached.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479411 13f79535-47bb-0310-9956-ffa450edef68
2013-05-05 22:27:31 +00:00
Graham Leggett
0eb8aa4a48 mod_cache: Honour Cache-Control: no-store in a request.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479222 13f79535-47bb-0310-9956-ffa450edef68
2013-05-05 01:12:48 +00:00
Graham Leggett
4d2b3c1a7d mod_cache: RFC2616 14.9.3 The s-maxage directive also implies the
semantics of the proxy-revalidate directive.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479216 13f79535-47bb-0310-9956-ffa450edef68
2013-05-04 23:03:13 +00:00
Graham Leggett
d1612031a9 mod_cache: Make sure that contradictory entity headers present in a 304
Not Modified response are caught and cause the entity to be removed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479117 13f79535-47bb-0310-9956-ffa450edef68
2013-05-04 14:55:03 +00:00
Graham Leggett
f18afbfba1 mod_cache: When serving from cache, only the last header of a multivalued
header was taken into account. Fixed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1478441 13f79535-47bb-0310-9956-ffa450edef68
2013-05-02 16:51:27 +00:00
Graham Leggett
9f68cf2010 mod_cache: Ignore response headers specified by no-cache=header and
private=header as specified by RFC2616 14.9.1 What is Cacheable. Ensure
that these headers are still processed when multiple Cache-Control 
headers are present in the response. PR 54706


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1478382 13f79535-47bb-0310-9956-ffa450edef68
2013-05-02 14:24:26 +00:00
Graham Leggett
d32086bb4c Apply log message tags to messages.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1478173 13f79535-47bb-0310-9956-ffa450edef68
2013-05-01 20:06:57 +00:00
Graham Leggett
6e77e5b20f mod_cache: Invalidate cached entities in response to RFC2616 Section
13.10 Invalidation After Updates or Deletions. PR 15868

Resolves outstanding issue with r1070179 as per
http://www.gossamer-threads.com/lists/apache/dev/395830?do=post_view_threaded#395830


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1478140 13f79535-47bb-0310-9956-ffa450edef68
2013-05-01 18:49:04 +00:00
Christophe Jaillet
aa6112daa6 Make option "CacheDisable" in mod_cache case insensitive.
PR 54462 reported by Tianyin Xu [tixu cs ucsd edu]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1464721 13f79535-47bb-0310-9956-ffa450edef68
2013-04-04 20:13:19 +00:00
Rainer Jung
dba4500a80 Cache does no longer send Content-Type header
for fresh content.

Followup to r1361153+r1373447 (PR 53539, wrong
Content-Type for stale content).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1439083 13f79535-47bb-0310-9956-ffa450edef68
2013-01-27 13:49:17 +00:00
Jeff Trawick
85ec79e3ce The following now respects DefaultRuntimeDir/DEFAULT_REL_RUNTIMEDIR:
- mod_cache: thundering herd lock directory


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1407381 13f79535-47bb-0310-9956-ffa450edef68
2012-11-09 08:44:08 +00:00
Rainer Jung
d247f6bafb Wrong content type and character set when
mod_cache serves stale content because of
a proxy error.

PR 53539.

Correction to r1361153.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1373447 13f79535-47bb-0310-9956-ffa450edef68
2012-08-15 15:06:24 +00:00
Ruediger Pluem
423370980e * Set content type in case we return stale content.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1361153 13f79535-47bb-0310-9956-ffa450edef68
2012-07-13 11:04:09 +00:00
Stefan Fritsch
d79b3c1513 Fix various filter functions to return apr_status_t instead of int
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1240315 13f79535-47bb-0310-9956-ffa450edef68
2012-02-03 19:48:01 +00:00
Graham Leggett
26559c25c5 mod_cache: Remove ap_cache_liststr(), it duplicates ap_find_token().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209798 13f79535-47bb-0310-9956-ffa450edef68
2011-12-03 00:31:53 +00:00
Stefan Fritsch
92e366007c Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +00:00
Jim Jagielski
f66d79b8b2 Use varargs...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1205894 13f79535-47bb-0310-9956-ffa450edef68
2011-11-24 15:53:16 +00:00
Jim Jagielski
bf2fc8ee54 Use ap_pass_brigade_fchk()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1205423 13f79535-47bb-0310-9956-ffa450edef68
2011-11-23 15:01:42 +00:00
Jim Jagielski
0871cc77f8 value never used: dead assignment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204555 13f79535-47bb-0310-9956-ffa450edef68
2011-11-21 15:51:44 +00:00
Graham Leggett
d4780b88c9 mod_cache: Make sure we merge headers correctly when we handle a non
cacheable conditional response. PR52120.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1201331 13f79535-47bb-0310-9956-ffa450edef68
2011-11-12 21:24:47 +00:00
Graham Leggett
1d8184a974 mod_cache: Ensure that CacheDisable can correctly appear within
a LocationMatch.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1158022 13f79535-47bb-0310-9956-ffa450edef68
2011-08-15 21:28:08 +00:00
Graham Leggett
c951f5e999 mod_cache: Fix the moving of the CACHE filter, which erroneously
stood down if the original filter was not added by configuration.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1157976 13f79535-47bb-0310-9956-ffa450edef68
2011-08-15 20:09:38 +00:00
Graham Leggett
26f144c3d2 mod_cache: Ensure that r->content_type is set when serving stale
content in response to a failed attempt to revalidate.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132816 13f79535-47bb-0310-9956-ffa450edef68
2011-06-06 22:44:31 +00:00
Graham Leggett
f23aeced40 mod_cache: Clarify which scenario we have present, quick handler on and CACHE
filter present, which is an error, or the CACHE filter being present when the
cache is bypassed, which is business as usual.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1126575 13f79535-47bb-0310-9956-ffa450edef68
2011-05-23 16:41:00 +00:00
Graham Leggett
ef3dbf5cbd Both lastmod and lastmods resolve to 0 when unset, but only lastmods is a
pointer. Fix comparison between apr_time_t and NULL.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1103850 13f79535-47bb-0310-9956-ffa450edef68
2011-05-16 19:25:07 +00:00
Graham Leggett
e4133460ec mod_cache: When content is served stale, and there is no means to
revalidate the content using ETag or Last-Modified, and we have
mandated no stale-on-error behaviour, stand down and don't cache.
Saves a cache write that will never be read.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1103494 13f79535-47bb-0310-9956-ffa450edef68
2011-05-15 18:15:48 +00:00
Graham Leggett
e8f8ab7863 mod_cache: Make CacheEnable and CacheDisable configurable per
directory in addition to per server, making them work from within
a LocationMatch.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1080834 13f79535-47bb-0310-9956-ffa450edef68
2011-03-12 01:15:28 +00:00
Graham Leggett
43fc2d47c7 mod_cache: When a request other than GET or HEAD arrives, we must
invalidate existing cache entities as per RFC2616 13.10. PR 15868.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070179 13f79535-47bb-0310-9956-ffa450edef68
2011-02-13 02:03:29 +00:00