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

435 Commits

Author SHA1 Message Date
Nick Kew
8b659b457c mod_cache: correctly parse quoted strings in cache headers.
PR 50199


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1030299 13f79535-47bb-0310-9956-ffa450edef68
2010-11-03 00:16:47 +00:00
Daniel Earl Poirier
4c477008d4 Add to modules' help text (displayed by ./configure -h) more
information that will be useful in deciding whether to enable
them or not.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1029814 13f79535-47bb-0310-9956-ffa450edef68
2010-11-01 20:02:51 +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
5aff0e237b mod_disk_cache: Make sure we step down cleanly when we've ben configured
to cache but haven't set a CacheRoot.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1026612 13f79535-47bb-0310-9956-ffa450edef68
2010-10-23 12:36:23 +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
27f5e0099b Be more efficient when handling the Expires header.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023955 13f79535-47bb-0310-9956-ffa450edef68
2010-10-18 19:11:10 +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
dc1fb839b5 Optimise the configuration structures for mod_disk_cache.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023528 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 16:58:11 +00:00
Graham Leggett
4994a28f2f Optimise the configuration structures for mod_cache.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023526 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 16:52:16 +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
3a3becfa67 Support Cache-Control: no-cache with a header name, and private with a
header name, which causes a cached entry to require revalidation (ie
is always not-fresh), as per RFC2616 14.9.1.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023399 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 01:34:04 +00:00
Graham Leggett
c7194e2e36 Don't attempt to kill a stale entry that cannot be revalidated so early
in the process, as this will happen later anyway as necessary. We may want
to serve the stale entry should the backend not be available.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023398 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 01:24:24 +00:00
Graham Leggett
b4ecd74a9e As cache_control_t is public, make ap_cache_control() public with it. Bump
the MMN for addition of ap_cache_control(), and the addition of cache_control_t
to the disk format.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023397 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 00:59:44 +00:00
Graham Leggett
3b619648dc Don't attempt to remove the existing conditional headers until we have
committed to adding our own.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023396 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 00:50:28 +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
fc7955190f Fix the error cases in the cache_select() loop. On error we must loop around
to the next provider, not return DECLINED too early, except for the
revalidate case, where returning DECLINED is correct behaviour.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023392 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 00:01:45 +00:00
Graham Leggett
44584f6a5a Fix the return values in the cache_select() function, we don't return APR
error codes in this case.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023390 13f79535-47bb-0310-9956-ffa450edef68
2010-10-16 23:42:25 +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
796d4cd074 Begin the process of optimising the parsing of Cache-Control headers. Parse
the incoming Cache-Control and Pragma headers once, instead of on each test.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023360 13f79535-47bb-0310-9956-ffa450edef68
2010-10-16 19:30:08 +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
William A. Rowe Jr
d4c3801625 Eliminate nonportable cruft
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1021527 13f79535-47bb-0310-9956-ffa450edef68
2010-10-11 21:54:26 +00:00
Graham Leggett
fe000fbe5d Remove (and no longer initialise) an unused variable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1004463 13f79535-47bb-0310-9956-ffa450edef68
2010-10-04 22:35:54 +00:00
Graham Leggett
38d82baaae mod_cache: Don't regenerate the cache key if we have already generated it.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1004373 13f79535-47bb-0310-9956-ffa450edef68
2010-10-04 19:27:22 +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
f21e960d57 Make sure the has_body flag is written to the disk cache file, so that
we don't interpret subsequent bodies as empty.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1003893 13f79535-47bb-0310-9956-ffa450edef68
2010-10-02 21:38:49 +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
1fea6c7441 mod_disk_cache: CacheMaxFileSize, CacheMinFileSize, CacheReadSize and
CacheReadTime can be set per directory/location.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1003839 13f79535-47bb-0310-9956-ffa450edef68
2010-10-02 17:31:35 +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
2daba6a048 mod_disk_cache: Instead of creating an empty data file when the body is
empty, don't create a file at all, saving inodes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1002832 13f79535-47bb-0310-9956-ffa450edef68
2010-09-29 20:00:11 +00:00
Graham Leggett
1aeb087542 mod_disk_cache: Change on-disk header file format to support the
link of the device/inode of the data file to the matching header
file, and to support the option of not writing a data file when
the data file is empty. Refactor the mod_disk_cache code so that
headers are written as late as possible (on commit), allowing the
device and inode of the body to be written to the header. At this
point, writes to the cache are now atomic, without locks.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1002643 13f79535-47bb-0310-9956-ffa450edef68
2010-09-29 14:17:52 +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
Jeff Trawick
aa0f1075bb axe extra ";", fixing this messages from Sun Studio:
warning: syntax error:  empty declaration


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1001864 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27 18:41:33 +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
Guenter Knauf
53ecdfd1c0 Fixed NetWare import/export list for cache modules.
Reported by normw AT gknw.net.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000761 13f79535-47bb-0310-9956-ffa450edef68
2010-09-24 08:49:49 +00:00
Graham Leggett
46a24e84f8 Remove a relic from the original error code, and fix segfaults in the
process.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000395 13f79535-47bb-0310-9956-ffa450edef68
2010-09-23 10:17:07 +00:00
Graham Leggett
18a8c46a59 Move mod_cache-private includes and defines from the public mod_cache.h
interface into the private cache_util.h interface.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000249 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 21:55:27 +00:00
Graham Leggett
fe32c3562b Make cache_provider_list and cache_request_rec private by moving them
out of mod_cache.h.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000247 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 21:35:38 +00:00
Graham Leggett
5c7154ed33 Make cache_server_conf, cache_enable and cache_disable private. Remove
public prefixes from ap_cache_accept_headers, ap_cache_try_lock and
ap_cache_get_providers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000211 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 20:44:50 +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
7e215375d2 Trim legacy structure from removed mod_mem_cache.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000160 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 19:56:06 +00:00