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
11b28165af
Don't skip the first character, as it may be a quote, which is handled
...
by the walk below.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070699 13f79535-47bb-0310-9956-ffa450edef68
2011-02-14 23:54:14 +00:00
063415fc4a
fix theoretical const issue in call to strchr()
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070627 13f79535-47bb-0310-9956-ffa450edef68
2011-02-14 19:47:31 +00:00
bd9b56da19
mod_cache: We must ignore quoted-string values that appear in a
...
Cache-Control header. PR 50199.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070075 13f79535-47bb-0310-9956-ffa450edef68
2011-02-12 13:08:57 +00:00
dd0370c5e2
mod_cache: Respect s-maxage as described by RFC2616 14.9.3, which must
...
take precedence if present. PR 35247.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1069942 13f79535-47bb-0310-9956-ffa450edef68
2011-02-11 20:12:39 +00:00
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
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
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
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
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
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
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
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
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
f427138d29
Remove deprecated ap_cache_cacheable_hdrs_out.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000159 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 19:52:25 +00:00
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
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
c3084aa4de
mod_cache: Check the request to determine whether we are allowed
...
to return cached content at all, and respect a "Cache-Control:
no-cache" header from a client. Previously, "no-cache" would
behave like "max-age=0".
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@992625 13f79535-47bb-0310-9956-ffa450edef68
2010-09-04 15:20:30 +00:00
f6af484cea
Pass the huge apr_uri_t structs by reference instead of by value
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982012 13f79535-47bb-0310-9956-ffa450edef68
2010-08-03 19:39:03 +00:00
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
b82a2f2829
* According to RFC2616 13.2.3 1. negative results of age calculations should
...
be replaced by zero.
Reported by: Ryujiro Shibuya <rshibuya gmail.com>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@933886 13f79535-47bb-0310-9956-ffa450edef68
2010-04-14 08:57:18 +00:00
a922151440
Style fixes.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821539 13f79535-47bb-0310-9956-ffa450edef68
2009-10-04 13:24:46 +00:00
a2bb3c8022
Remove the server_rec wired into uri_meets_conditions, the debugging
...
statements that required it were removed in the past, so wiring through
server_rec is no longer necessary.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821538 13f79535-47bb-0310-9956-ffa450edef68
2009-10-04 13:21:25 +00:00
050515d99f
mod_cache: Fix uri_meets_conditions() so that CacheEnable will
...
match by scheme, or by a wildcarded hostname.
PR: 40169
Submitted by: Peter Grandi <pg_asf asf.for.sabi.co.uk>
Reviewed by: Graham Leggett
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821333 13f79535-47bb-0310-9956-ffa450edef68
2009-10-03 14:54:00 +00:00
383a108c07
Add suggested parentheses around APR_STATUS_IS_ENOENT.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@809665 13f79535-47bb-0310-9956-ffa450edef68
2009-08-31 17:11:27 +00:00
17d2895c44
moved "finfo.mtime = 0;" after var declaration;
...
removed tab.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@809440 13f79535-47bb-0310-9956-ffa450edef68
2009-08-31 00:22:44 +00:00
23a2ebfd33
Add parenthesis for legibility and correcting association,
...
and axe an unused variable
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808723 13f79535-47bb-0310-9956-ffa450edef68
2009-08-28 01:31:23 +00:00
fd5c214124
Make sure when adding a warning, that we don't duplicate an existing warning.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808656 13f79535-47bb-0310-9956-ffa450edef68
2009-08-27 21:57:27 +00:00
2e32dbe9b5
When attempting to set the stale lock, we will pass try_lock twice. If we
...
already have the lock the first time, we must also have the lock the second
time.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808649 13f79535-47bb-0310-9956-ffa450edef68
2009-08-27 21:44:48 +00:00
9bf71872c9
Reintroduce an optimisation lost in some cut and paste. The cache lock
...
is removed as soon as we see an EOS, or is removed immediately if a
failure has occurred.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808220 13f79535-47bb-0310-9956-ffa450edef68
2009-08-26 23:22:18 +00:00
2c379cc6fb
mod_cache: Introduce the thundering herd lock, a mechanism to keep
...
the flood of requests at bay that strike a backend webserver as
a cached entity goes stale.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808212 13f79535-47bb-0310-9956-ffa450edef68
2009-08-26 22:46:35 +00:00
8433cdfe67
* Correctly save Content-Encoding of cachable entity.
...
PR: 46401
Submitted by: Dan Poirier <poirier pobox.com>
Reviewed by: rpluem
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@726796 13f79535-47bb-0310-9956-ffa450edef68
2008-12-15 20:45:29 +00:00
6c1424b8d2
* We need to use the headers_out table we merged above, not the original one.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649793 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 10:25:16 +00:00
bed15a9a7f
* Style fixes. No functional changes.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649792 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 10:15:14 +00:00
907b78b12d
* Use the correct headers_out table for overlaying.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649791 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 10:13:34 +00:00
b3c481970a
Centralize the error-header collapsing done when sending out cached replies. Mark the change in CHANGES as it may have unforseen fall out and/or may need to be reverted or done more subtle.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649460 13f79535-47bb-0310-9956-ffa450edef68
2008-04-18 11:05:25 +00:00
a9091bba7f
Make it compile on pre-C99 compilers
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649446 13f79535-47bb-0310-9956-ffa450edef68
2008-04-18 10:06:20 +00:00
e1ae2aa551
* Style police. No functional changes.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649228 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 18:48:18 +00:00
53d475f654
Currently each of the caching module includes logic to implement
...
the hop-by-hop rules of rfc 2616 along with the entity response
rules. To make sure that they stay in sync; and to make it easier
to add (http) caching modules - this change moves them all into
one place (cache_util) and exposes a in-bound and out-bound
version to operate on the headers.
In short: we retire ap_cache_cacheable_hdrs_out() which was used
for both in- and out-put headers; and replace it by a single
ap_cache_cacheable_headers() which understands the hop-by-hop
rules. And then wrap this into an in- and out-put specific
ap_cache_cacheable_headers_in()/out() which we can teach things
about entity responses and so on.. The latter which will also
merge error and ensure content-type.
This API change bumps up the minor MM by one.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649162 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 16:03:13 +00:00
a324a1d72f
Remove all references to CORE_PRIVATE.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645455 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 10:45:43 +00:00
00cd3798d1
* If the cached entity contained Cache-Control: no-cache, treat it as stale
...
causing revalidation.
PR: 44511
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@632749 13f79535-47bb-0310-9956-ffa450edef68
2008-03-02 12:35:33 +00:00
6ad514ccc1
* Prevent a segmentation fault if one of the Cache-Control headers
...
s-maxage, max-age, min-fresh, max-stale has no value assigned.
In this case ignore s-maxage, max-age, min-fresh. For max-stale
it is valid to set no value. In this case set max-stale to 1 year
to signal that the client is accepting a stale response of any age.
Submitted by: Niklas Edmundsson <nikke acc.umu.se>
Reviewed by: rpluem
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@535617 13f79535-47bb-0310-9956-ffa450edef68
2007-05-06 14:35:02 +00:00
d010f24449
mod_cache: From RFC3986 (section 6.2.3.) if a URI contains an
...
authority component and an empty path, the empty path is to be equivalent
to "/". It explicitly cites the following four URIs as equivalents:
http://example.com
http://example.com/
http://example.com:/
http://example.com:80/
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@450063 13f79535-47bb-0310-9956-ffa450edef68
2006-09-26 14:36:43 +00:00
de659cbed0
update license header text
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
a8482b67cf
* info->expire and info->date are in microseconds. So convert the difference
...
to seconds before comparing it to age which is in seconds.
PR: 39713
Submitted by: Owen Taylor <otaylor redhat.com>
Reviewed by: rpluem
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@411464 13f79535-47bb-0310-9956-ffa450edef68
2006-06-03 19:41:49 +00:00
dd95d7c37c
Update the copyright year in all .c, .h and .xml files
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
5061d9fa92
No functional Change: Removing trailing whitespace. This also
...
means that "blank" lines consisting of just spaces or
tabs are now really blank lines
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
5d2fae4818
No functional change: simple detabbing of indented code.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332305 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:05:51 +00:00
d7bd8dbda1
Two minor whitespace cleanups. Syncs with the 2.2.x branch.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@293291 13f79535-47bb-0310-9956-ffa450edef68
2005-10-03 10:30:52 +00:00
acf227a492
Enhance CacheEnable/CacheDisable to control caching on a per-protocol, per-host
...
and per-path basis. Makes Cache(En|Dis)able useful for forward proxy servers.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@239421 13f79535-47bb-0310-9956-ffa450edef68
2005-08-23 15:43:23 +00:00