look for 'no-cache' in subprocess_env to prevent the saving
of an otherwise cacheable response.
document no-cache envvar
Submitted by: covener
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@733762 13f79535-47bb-0310-9956-ffa450edef68
When an expires or cache-control header are sent, the RFC does allow us to cache normally non-cacheable response statuses.
Submitted by: Alex Polvi <alex polvi.net>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@727599 13f79535-47bb-0310-9956-ffa450edef68
* 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, jim, jfclere
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@720171 13f79535-47bb-0310-9956-ffa450edef68
are undecorated, their .h files are not propagated into
an installed include/ tree, and were erroniously exported.
This doesn't require an mmn bump, because anyone who might
have consumed these modules would have succeeded only with
win32, consuming private headers, and absolutely fails on unix.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@664149 13f79535-47bb-0310-9956-ffa450edef68
* Restore the original request headers if the cached resource was stale, as they
may be needed by further output filters like the byterange filter to make the
correct decisions.
PR: 44579
* Do not do Range requests if we use our own conditionals for validating
a cache entity: If we get 304 the Range does not matter and otherwise the
entity changed and we want to have the complete entity.
PR: 44579
Submitted by: rpluem
Reviewed by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@660584 13f79535-47bb-0310-9956-ffa450edef68
* Remove temporary files if renaming fails, otherwise they may accumulate.
* Make loglevel consistent for similar situations. As this really should not
happen set it to error.
* Change loglevel from ERROR to WARNING if the renaming of the vary, headers
or data file fails.
Submitted by: Davi Arnaut <davi haxent.com.br>
Reviewed by: rpluem, niq, wrowe
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@607443 13f79535-47bb-0310-9956-ffa450edef68
* Increase the minimum and default value for MCacheMinObjectSize from 0 to 1,
as a MCacheMinObjectSize of 0 does not make sense and leads to a
signal Floating point exception (8) (division by zero) in
memcache_gdsf_algorithm.
PR: 40576
Submitted by: Xuekun Hu <xuekun.hu gmail.com>
Reviewed by: rpluem
Submitted by: rpluem
Reviewed by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@572628 13f79535-47bb-0310-9956-ffa450edef68
mod_cache: Correctly handle HEAD requests on expired cache content. PR 41230.
* modules/cache/mod_cache.c
(cache_save_filter): Properly handle HEAD responses when we have a stale handle.
(This patch was revised by Justin/Ruediger.)
Submitted by: Niklas Edmundsson
Reviewed by: Justin, Ruediger
Submitted by: jerenkrantz
Reviewed by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@553596 13f79535-47bb-0310-9956-ffa450edef68
* 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: mjc, rpluem, jorton
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@551944 13f79535-47bb-0310-9956-ffa450edef68
* Save the key we generate during our first run of cache_generate_key_default
on each request in the request_config. During consecutive runs of
cache_generate_key_default during processing the request we restore it
from there as we might not be able to generate the same key again as
the ingredients used to compose the key might have changed and we constantly
must use a key that could be generated during the quick handler phase.
PR: 41475
Submitted by: rpluem
Reviewed by: rpluem, jerenkrantz, jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@539112 13f79535-47bb-0310-9956-ffa450edef68
* Add CacheIgnoreQueryString directive to cache requests with a query string
even if no expiration time is specified. Futhermore the query string will not
be used for key generation such that requests to the same URI path, but with
different query strings are mapped to the same cache entity. Turning this
setting to ON violates RFC 2616/13.9 and thus it is turned off by default.
PR: 41484
Submitted by: Fredrik Widlund <fredrik.widlund qbrick.com>
Reviewed by: rpluem, jerenkrantz, jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@539111 13f79535-47bb-0310-9956-ffa450edef68
* Remove all filters that are before the cache_out filter. This ensures
that we kick off the filter stack with our cache_out filter being the
first in the chain. This make sense because we want to restore things
in the same manner as we saved them.
There may be filters before our cache_out filter, because
1. We call ap_set_content_type during cache_select. This causes
Content-Type specific filters to be added.
2. We call the insert_filter hook. This causes filters e.g. like
the ones set with SetOutputFilter to be added.
PR: 40090
Submitted by: rpluem
Reviewed by: rpluem, wrowe, jerenkrantz
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@538868 13f79535-47bb-0310-9956-ffa450edef68
* Use the query string stored in r->parsed_uri.query instead of r->args
as r->args could have been changed (e.g. via mod_rewrite) after the quick
handler hook. This causes resources to be stored under a key, where they
cannot be fetched again in the quick handler.
PR: 40805
Submitted by: rpluem
Reviewed by: rpluem, jim, sctemme
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@535903 13f79535-47bb-0310-9956-ffa450edef68
(Studio 2005, 'free' Express or full edition) command line builds.
Backports 495126, adjusted for debugging/debug path change between
trunk and 2.2 branch.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@495130 13f79535-47bb-0310-9956-ffa450edef68
otherwise mod_cache will always try to cache the URL. This bug
might lead to numerous rename() errors on win32 if the URL was
previously cached.
+1: minfrin, rpluem, jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@463496 13f79535-47bb-0310-9956-ffa450edef68
* Keep the Content-Type for successfully revalidated
cached objects, by unsetting possible Content-Type headers in
r->headers_out and r->err_headers_out as they may be different to what
we have received from the cache.
Actually they are not needed as r->content_type set by
ap_set_content_type a few lines above will be used in the store_headers
functions of the storage providers as a fallback and the HTTP_HEADER filter
does overwrite the Content-Type header with r->content_type anyway.
PR: 39647
Submitted by: rpluem
Reviewed by: rpluem, pquerna, fielding
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@425725 13f79535-47bb-0310-9956-ffa450edef68
* Handle the cases "no proxy request" and "reverse proxy request" in the same
manner, when setting scheme and port_str. This is needed because if a cached
entry is looked up by mod_cache's quick handler r->proxyreq
is still unset in the reverse proxy case as it only gets set in the
translate name hook (either by ProxyPass or mod_rewrite) which is run
after the quick handler hook. This is different to the forward proxy
case where it gets set before the quick handler is run (in the
post_read_request hook).
If a cache entry is created by the CACHE_SAVE filter we always have
r->proxyreq set correctly.
Also set scheme to ap_http_scheme(r) instead of "http" to handle SSL
correctly.
* Fix const compiler warning introduced by r407357.
Noticed by: Joe Orton
* Cleanup the code by replacing some inline code to lower-case a string with
ap_str_tolower.
Proposed by: Joe Orton
PR: 39593
Submitted by: rpluem
Reviewed by: rpluem, jim, pquerna
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@425035 13f79535-47bb-0310-9956-ffa450edef68
* Add Content-Type to headers_out if not already set. This ensures that
the Content-Type of the cached entity gets restored correctly.
PR: 39266
Submitted by: rpluem
Reviewed by: rpluem, trawick, jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@410932 13f79535-47bb-0310-9956-ffa450edef68
of switching linkers from the x86 (default linker) to x64 or other
possible target platforms. (Also this commit cleans up lingering
/GX switches from the 'BASE' options that are supposed to be unused.)
Backports: 397407
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@397649 13f79535-47bb-0310-9956-ffa450edef68
win32 builders, eliminate platform-specific use of 'awk' to create
our .rc resources. (Deliberately waited until a clean 2.2.2 was
pulled from the branch.) The end goal is to make building simpler
for our 'free' VisualStudio 2005 Express users, to encourage more
end users to explore the source code. Eliminating thousands of
lines of build-script is a nice side effect.
Backports: 395418
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@396974 13f79535-47bb-0310-9956-ffa450edef68
Reviewed by all active win32 contributors, and committed as an arch
maintenance fix. This permits Win32 VisualStudio 2005 users to build
httpd without extranious 'deprectated option' emits.
Reviewed by: wrowe, colm
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@395961 13f79535-47bb-0310-9956-ffa450edef68
* Fix PR38017 by handling the selection of the hostname in the same way for
non proxied and reverse proxied requests.
We need to handle both cases in the same manner as for the reverse proxy
case we have the following situation:
If a cached entry is looked up by mod_cache's quick handler r->proxyreq
is still unset in the reverse proxy case as it only gets set in the
translate name hook (either by ProxyPass or mod_rewrite) which is run
after the quick handler hook. This is different to the forward proxy
case where it gets set before the quick handler is run (in the
post_read_request hook).
If a cache entry is created by the CACHE_SAVE filter we always have
r->proxyreq set correctly.
So we must ensure that in the reverse proxy case we use the same code
path and using the canonical name seems to be the right thing to do
in the reverse proxy case.
PR: 38017
Submitted by: rpluem
Reviewed by: rpluem, wrowe, colm
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@374931 13f79535-47bb-0310-9956-ffa450edef68