1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-05 05:30:39 +03:00
Commit Graph

122 Commits

Author SHA1 Message Date
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
Graham Leggett
b591028272 mod_cache: Make sure that the moving of the CACHE filter to another
point within a subrequest is limited to affecting filters in that
subrequest only.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070161 13f79535-47bb-0310-9956-ffa450edef68
2011-02-12 23:21:18 +00:00
Graham Leggett
11a01ec97a mod_cache: When a bad Expires date is present, we need to behave as if
the Expires is in the past, not as if the Expires is missing. PR 16521.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070128 13f79535-47bb-0310-9956-ffa450edef68
2011-02-12 19:02:58 +00:00
Rainer Jung
c8f912e613 Further trivial updates mod_disk_cache -> mod_cache_disk.
No functional change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1039300 13f79535-47bb-0310-9956-ffa450edef68
2010-11-26 10:20:16 +00:00
Graham Leggett
c703098430 Fix a spelling mistake.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1036702 13f79535-47bb-0310-9956-ffa450edef68
2010-11-19 01:16:56 +00:00
Graham Leggett
8cad24ec5c Fix a spelling mistake.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1036699 13f79535-47bb-0310-9956-ffa450edef68
2010-11-19 01:01:21 +00:00
Graham Leggett
9619a17b78 mod_cache: Respect the original Cache-Control header if no header arrives
with a 304 Not Modified.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1026617 13f79535-47bb-0310-9956-ffa450edef68
2010-10-23 14:11:20 +00:00
Graham Leggett
8de5190445 Be compliant with RFC2616 14.46, revalidation failed is Warning 111, not
Warning 110.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1026173 13f79535-47bb-0310-9956-ffa450edef68
2010-10-21 23:00:09 +00:00
Graham Leggett
e5ac8f4ccc Remove the remove_url filter consistently for both the ap_die() and the
mod_proxy cases.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023952 13f79535-47bb-0310-9956-ffa450edef68
2010-10-18 19:04:21 +00:00
Graham Leggett
f5d5cd33c5 Use ap_log_rerror() instead of ap_log_error() across mod_cache and
mod_disk_cache.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023462 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 11:34:03 +00:00
Graham Leggett
7ce9abf618 Support Cache-Control: only-if-cached, as per RFC2616 14.9.4.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023394 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 00:20:41 +00:00
Graham Leggett
e0d571b1f3 Add support for proxy-revalidate as per RFC2616 section 14.9.4.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023389 13f79535-47bb-0310-9956-ffa450edef68
2010-10-16 23:32:45 +00:00
Graham Leggett
c80d38ba8c Fix the sense of the must_revalidate comparison. Replace a further call to
ap_cache_liststr() with a pre-parsed value.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023388 13f79535-47bb-0310-9956-ffa450edef68
2010-10-16 23:24:09 +00:00
Graham Leggett
7229aa211b Complete the optimisation of Cache-Control header parsing. Make the
cache_control_t structure public so as to be available to mod_disk_cache.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023387 13f79535-47bb-0310-9956-ffa450edef68
2010-10-16 23:15:52 +00:00
Graham Leggett
109ca9b737 mod_cache: Support stale-on-error behaviour for the mod_proxy case in
addition to the existing case where the error was generated by ourselves.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1021946 13f79535-47bb-0310-9956-ffa450edef68
2010-10-12 22:54:06 +00:00
Graham Leggett
bf69cf6369 Make sure we remove the cache lock consistently as soon as we've started
down the error path, so that we don't delay the next attempt to cache.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1021944 13f79535-47bb-0310-9956-ffa450edef68
2010-10-12 22:43:49 +00:00
Graham Leggett
d1da525e05 Restore the apr_brigade_insert_file() call to within recall_body(), as the
function does more than add a single file bucket. Pass an empty brigade
to recall_body(), and prepend the result to the existing output brigade,
the next bucket being eos.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1021917 13f79535-47bb-0310-9956-ffa450edef68
2010-10-12 20:43:51 +00:00
Graham Leggett
0f267cd6ad mod_cache: Optionally serve stale data when a revalidation returns a
5xx response, controlled by the CacheStaleOnError directive.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1021546 13f79535-47bb-0310-9956-ffa450edef68
2010-10-11 23:32:56 +00:00
Graham Leggett
97b03cc25c Use the more popular spelling variant.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1021544 13f79535-47bb-0310-9956-ffa450edef68
2010-10-11 23:23:57 +00:00
Graham Leggett
16274f6ad6 Fix the lookup of the per-directory cache config, we were looking up the
per-server config instead.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1021543 13f79535-47bb-0310-9956-ffa450edef68
2010-10-11 23:21:14 +00:00
Graham Leggett
7e03f9e8c0 Remove the attempt to pass the cache key into the lock functions, use
cache->key instead for this. Fixes a segfault caused when cache->key
was populated, but the passed in key was not.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1004220 13f79535-47bb-0310-9956-ffa450edef68
2010-10-04 12:46:06 +00:00
Graham Leggett
d29eacb478 mod_cache: Allow control over the base URL of reverse proxied requests
using the CacheKeyBaseURL directive, so that the cache key can be
calculated from the endpoint URL instead of the server URL.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1003963 13f79535-47bb-0310-9956-ffa450edef68
2010-10-03 13:23:39 +00:00
Graham Leggett
b9ba2169a9 Realign the cache_quick_handler() and cache_handler() to behave identically
to the default_handler() when it comes to reacting to errors when writing
to the filter stack. Previously the error message implied the cache had
failed, when in reality, any part of the filter stack may have returned an
error.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1003913 13f79535-47bb-0310-9956-ffa450edef68
2010-10-02 23:17:47 +00:00
Graham Leggett
422e4393e1 Remove FIXMEs, they have been fixed.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1003905 13f79535-47bb-0310-9956-ffa450edef68
2010-10-02 22:20:07 +00:00
Graham Leggett
5ec95ec848 mod_cache: CacheLastModifiedFactor, CacheStoreNoStore, CacheStorePrivate,
CacheStoreExpired, CacheIgnoreNoLastMod, CacheDefaultExpire, 
CacheMinExpire and CacheMaxExpire can be set per directory/location.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1003882 13f79535-47bb-0310-9956-ffa450edef68
2010-10-02 20:57:38 +00:00
Graham Leggett
44b825b72c mod_cache: Support the caching of HEAD requests.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1003331 13f79535-47bb-0310-9956-ffa450edef68
2010-09-30 23:25:15 +00:00
Graham Leggett
5059403b56 mod_cache: Make sure that we never allow a 304 Not Modified response
that we asked for to leak to the client should the 304 response be
uncacheable. PR45341


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1001884 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27 19:28:40 +00:00
Graham Leggett
61b7c8574b mod_cache: Add the cache_status hook to register the final cache
decision hit/miss/revalidate. Add optional support for an X-Cache
and/or an X-Cache-Detail header to add the cache status to the
response. PR48241


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1001639 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27 09:20:40 +00:00
Graham Leggett
8a91dc4dbe Make ap_cache_accept_headers, ap_cache_accept_headers, ap_cache_try_lock and
ap_cache_check_freshness private.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000187 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 20:28:11 +00:00
Graham Leggett
502a305b1d Remove the MOD_CACHE_REQUEST_REC hack, and pass the cache_request_rec
structure through mod_cache's function parameters in the usual way.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000152 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 19:35:26 +00:00
William A. Rowe Jr
9baaf4e800 Revert breakage in 2.2.4 introduced in r450055, by offering a CacheStoreExpired
directive to allow the user to override this questionable change.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000106 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 17:54:39 +00:00
Graham Leggett
c8de96f357 Move private cache_* declarations out of the public mod_cache.h file.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@999681 13f79535-47bb-0310-9956-ffa450edef68
2010-09-21 22:55:22 +00:00
Graham Leggett
d8fc5d96a8 mod_cache: Give the cache provider the opportunity to choose to cache
or not cache based on the buckets present in the brigade, such as the
presence of a FILE bucket.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@999630 13f79535-47bb-0310-9956-ffa450edef68
2010-09-21 20:43:44 +00:00
Graham Leggett
ca9d2ae938 mod_cache: Add a discrete commit_entity() provider function within the
mod_cache provider interface which is called to indicate to the
provider that caching is complete, giving the provider the opportunity
to commit temporary files permanently to the cache in an atomic
fashion. Move all "rename" functionality of temporary files to permanent
files within mod_disk_cache from ad hoc locations in the code to the
commit_entity() function. Instead of reusing the same variables for
temporary file handling in mod_disk_cache, introduce separate discrete
structures for each of the three cache file types, the headers file,
vary file and data file, so that the atomic rename of all three file
types within commit_entity() becomes possible. Replace the inconsistent
use of error cleanups with a formal set of pool cleanups attached to
a subpool, which is destroyed on error.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@997545 13f79535-47bb-0310-9956-ffa450edef68
2010-09-16 00:05:14 +00:00
Graham Leggett
665426645e mod_cache: Change the signature of the store_body() provider function
within the mod_cache provider interface to support an "in" brigade
and an "out" brigade instead of just a single input brigade. This
gives a cache provider the option to consume only part of the brigade
passed to it, rather than the whole brigade as was required before.
This fixes an out of memory and a request timeout condition that would
occur when the original document was a large file. Update the
mod_disk_cache provider implementation to take into account the new API.
Introduce CacheReadSize and CacheReadTime directives to mod_disk_cache
to control the amount of data to attempt to cache before sending the
data on to the client in the "out" brigade.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@996395 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12 23:16:49 +00:00
Stefan Fritsch
5604942f8f remove unused variables
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@992809 13f79535-47bb-0310-9956-ffa450edef68
2010-09-05 15:56:10 +00:00
Graham Leggett
8991d4795f mod_cache: Use a proper filter context to hold filter data instead
of misusing the per-request configuration. Fixes a segfault on trunk
when the normal handler is used.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@992614 13f79535-47bb-0310-9956-ffa450edef68
2010-09-04 14:42:30 +00:00