1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

106 Commits

Author SHA1 Message Date
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
Stefan Fritsch
aa576071af - Remove a load of unused variables (or variables that are set but never read).
- Move some declarations into the correct #ifdef scope.

I couldn't compile/test netware, but the changes look obvious enough.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982016 13f79535-47bb-0310-9956-ffa450edef68
2010-08-03 19:45:21 +00:00
Graham Leggett
a71d310a23 mod_cache: Explicitly allow cache implementations to cache a 206 Partial
Response if they so choose to do so. Previously an attempt to cache a 206
was arbitrarily allowed if the response contained an Expires or
Cache-Control header, and arbitrarily denied if both headers were missing.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@952823 13f79535-47bb-0310-9956-ffa450edef68
2010-06-08 21:13:06 +00:00
Stefan Fritsch
ebb62867fb Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
Graham Leggett
2e958275d9 Fix a bug where if the cache quick handler is switched off, and the CACHE
filter is manually added by the admin, but caching has not been enabled for
the URL space, an attempt is made to remove the CACHE_SAVE filter instead
of the CACHE filter. This fix makes the code work like the comment above
the code, the comment being correct.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951220 13f79535-47bb-0310-9956-ffa450edef68
2010-06-04 00:09:51 +00:00
Ruediger Pluem
8fa54a82f4 * Do NOT cache 206 responses in any case since we don't (yet) know how to
cache partial responses. Fixes regression of r724093.

PR: 49113


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@933919 13f79535-47bb-0310-9956-ffa450edef68
2010-04-14 12:00:11 +00:00
Jeff Trawick
93b1a9ca24 use ap_strchr_c to protect const-ness of input string
(and thus quiet gcc in maintainer mode)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832177 13f79535-47bb-0310-9956-ffa450edef68
2009-11-02 23:03:14 +00:00
Daniel Earl Poirier
17df062a0a mod_cache: add Cache-control: s-maxage to cacheability decisions per RFC 2616.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@823536 13f79535-47bb-0310-9956-ffa450edef68
2009-10-09 12:58:09 +00:00
Graham Leggett
ae50b75b92 mod_cache: Teach CacheEnable and CacheDisable to work from within a
Location section, in line with how ProxyPass works.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821993 13f79535-47bb-0310-9956-ffa450edef68
2009-10-05 20:27:19 +00:00
Daniel Earl Poirier
29a4d8a417 Back out r818492 which prevented all caching of incomplete responses.
Instead move the check to mod_disk_cache.  This leaves cache implementations
the flexibility to implement caching of incomplete responses.
PR: 15866


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821763 13f79535-47bb-0310-9956-ffa450edef68
2009-10-05 12:13:20 +00:00
Graham Leggett
f150bc9b04 Ensure that we call ap_meets_conditions() in the mod_cache normal handler
case, so that conditional requests are handled properly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821552 13f79535-47bb-0310-9956-ffa450edef68
2009-10-04 16:03:03 +00:00
Graham Leggett
f7ecd38d51 Remove an unused variable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821301 13f79535-47bb-0310-9956-ffa450edef68
2009-10-03 12:20:56 +00:00
Graham Leggett
3ae6189d47 mod_cache: Introduce the option to run the cache from within the
normal request handler, and to allow fine grained control over
where in the filter chain content is cached.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821202 13f79535-47bb-0310-9956-ffa450edef68
2009-10-02 23:47:37 +00:00
Ruediger Pluem
83fea47fea * Use strcasecmp instead of strncasecmp as we want to be sure that the whole
word is None and not only the beginning.

Noted by Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@819237 13f79535-47bb-0310-9956-ffa450edef68
2009-09-27 00:16:49 +00:00
Daniel Earl Poirier
546d17cd68 mod_cache: don't cache incomplete responses, per RFC 2616, 13.8.
PR: 15866


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@818492 13f79535-47bb-0310-9956-ffa450edef68
2009-09-24 14:25:19 +00:00
William A. Rowe Jr
1b68ef7771 Axe an unused variable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808724 13f79535-47bb-0310-9956-ffa450edef68
2009-08-28 01:32:18 +00:00
Graham Leggett
d3e08fa3ba Log the return code in the debug message to properly indicate why the lock
could not be obtained.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808652 13f79535-47bb-0310-9956-ffa450edef68
2009-08-27 21:47:26 +00:00