1
0
mirror of https://github.com/apache/httpd.git synced 2025-04-18 22:24:07 +03:00

27 Commits

Author SHA1 Message Date
Yann Ylavic
00bd49eaa5 mod_cache: Fix parsing of quoted Cache-Control token arguments. PR 63288.
Make cache_strqtok() return both the token and its unquoted argument (if any),
or an error if the parsing fails.

Cache-Control integer values (max-age, max-stale, ...) can then be parsed w/o
taking care of the (optional) quoting.

Suggested by: fielding


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1856493 13f79535-47bb-0310-9956-ffa450edef68
2019-03-28 16:39:39 +00:00
Yann Ylavic
fb5baf3b81 mod_cache: Fix a regression in 2.4.25 for the forward proxy case by
computing and using the same entity key according to when the cache
checks, loads and saves the request.  PR 60577.
 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783842 13f79535-47bb-0310-9956-ffa450edef68
2017-02-21 08:20:45 +00:00
Yann Ylavic
0370f02651 mod_cache: Use the actual URI path and query-string for identifying the
cached entity (key), such that rewrites are taken into account when
running afterwards (CacheQuickHandler off).  PR 21935.
 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756553 13f79535-47bb-0310-9956-ffa450edef68
2016-08-16 21:48:09 +00:00
Christophe Jaillet
46b3048bd6 RFC2616 defines #rules as:
#rule
      A construct "#" is defined, similar to "*", for defining lists of
      elements. The full form is "<n>#<m>element" indicating at least
      <n> and at most <m> elements, each separated by one or more commas
      (",") and OPTIONAL linear white space (LWS). This makes the usual
      form of lists very easy; a rule such as
         ( *LWS element *( *LWS "," *LWS element ))
      can be shown as
         1#element

It also defines Linear White Space (LWS) as:
   LWS            = [CRLF] 1*( SP | HT )


The actual implementation only accepts SP (Space) and not HT (Horizontal Tab) when parsing cache related header fields (i.e. "Vary", "Cache-Control" and "Pragma")

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1710723 13f79535-47bb-0310-9956-ffa450edef68
2015-10-27 06:45:03 +00:00
Rich Bowen
85f20cb5d2 s/the the/the/g
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1690120 13f79535-47bb-0310-9956-ffa450edef68
2015-07-09 16:01:56 +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
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
0ef0994152 mod_cache: Make sure Vary processing handles multivalued Vary headers and
multivalued headers referred to via Vary.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1478748 13f79535-47bb-0310-9956-ffa450edef68
2013-05-03 12:19:26 +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
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
Jeff Trawick
562c645ad6 change signed single-bit fields to unsigned
some of these were exposed to mods so the mmn is bumped, without
regard to whether any compiler will have to generate different
code


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086662 13f79535-47bb-0310-9956-ffa450edef68
2011-03-29 18:20:52 +00:00
Jeff Trawick
bc956c30c3 fix doxygen warnings
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086071 13f79535-47bb-0310-9956-ffa450edef68
2011-03-27 23:36:03 +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
Stefan Fritsch
ce6e4de41a Fix some doxygen warnings
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1043710 13f79535-47bb-0310-9956-ffa450edef68
2010-12-08 21:59:46 +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
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
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
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
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
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
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
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