1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-13 21:42:17 +03:00
Commit Graph

187 Commits

Author SHA1 Message Date
Ruediger Pluem
fd4bdc00ce * Create new filters CACHE_OUT_SUBREQ / CACHE_SAVE_SUBREQ which only differ
by the type (AP_FTYPE_CONTENT_SET-1) from CACHE_OUT / CACHE_SAVE
  (AP_FTYPE_CONTENT_SET+1). This ensures that subrequests to non local
  resources do not get stuck in the middle of the road with the contents
  only written to the temp file, because CACHE_OUT_SUBREQ / CACHE_SAVE_SUBREQ
  are inserted *before* the SUBREQ_CORE filter in the filter chain.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@325960 13f79535-47bb-0310-9956-ffa450edef68
2005-10-17 18:59:52 +00:00
Colm MacCarthaigh
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
Colm MacCarthaigh
6eeba097be Fixes and cleanups for mod_cache;
* Add r->uri to the debug messages in the quick handler; makes debugging
      easier.
    
    * Always reset headers_in for lookup's, some modules make subrequests
      and then rewrite the url. Having a conditional request at this point
      is not what they expect (nor reasonable for them to handle). 

    * Don't store a per-request config on lookups; for the same reason.

    * Return DECLINED when in lookup mode and ap_meets_conditions() indicated
      we have the content but don't know if it's fresh or not. We have no idea
      whether the backend will have a 404, a 304 or any other kind of a 
      response - so we have to assume we cannot handle the request.

    * remove the unused "url" argument from the cache_create_entity() function

    * Whitespace/comment fixups in mod_cache.h



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@291588 13f79535-47bb-0310-9956-ffa450edef68
2005-09-26 09:21:45 +00:00
Ian Holsman
8c1e315d3f Doxygen fixup / cleanup
submited by: Neale Ranns neale ranns.org
reviewed by: Ian Holsman



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@263931 13f79535-47bb-0310-9956-ffa450edef68
2005-08-28 23:03:59 +00:00
Colm MacCarthaigh
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
Colm MacCarthaigh
c6700d7708 remove some unused variables and re-name cache_select_url() to simply
cache_select()



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@239420 13f79535-47bb-0310-9956-ffa450edef68
2005-08-23 15:25:08 +00:00
Colm MacCarthaigh
2e702882bd Improve the cache hit/miss ratio by canonicalising the url key. hostname's
are matched case-insensitively, port-based vhosts are catered for and the
scheme included for future multi-scheme caching compatibility.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@239407 13f79535-47bb-0310-9956-ffa450edef68
2005-08-23 13:50:47 +00:00
Andreas Steinmetz
59a68232cc Split mod_disk_cache.c into mod_disk_cache.c and mod_disk_cache.h
to allow inclusion of mod_disk_cache.h in htcacheclean.c.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@239406 13f79535-47bb-0310-9956-ffa450edef68
2005-08-23 13:35:00 +00:00
Justin Erenkrantz
03a775765f Move the debuging log message about the removal of a url from
cache_remove_url_filter to cache_remove_url.

Submitted by: Rudiger Plum <ruediger.pluem vodafone.com>
Reviewed by: Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@232335 13f79535-47bb-0310-9956-ffa450edef68
2005-08-12 16:57:13 +00:00
Justin Erenkrantz
8998c32fb6 mod_disk_cache: Remove the directory path of the cached file as far as possible
(up to the cache root) to get rid of unused empty directories.

* cache/mod_disk_cache.c
  (remove_url): Try to delete directories; also change two APR_ENOENT to
  APR_STATUS_IS_ENOENT.

(Justin tweaked some comments.)

Submitted by: Rudiger Plum <ruediger.pluem vodafone.com>
Reviewed by: Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@232334 13f79535-47bb-0310-9956-ffa450edef68
2005-08-12 16:52:28 +00:00
Joe Orton
5d7d8f280f * modules/cache/cache_storage.c (cache_remove_url): Remove unused
variables.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@232272 13f79535-47bb-0310-9956-ffa450edef68
2005-08-12 11:32:55 +00:00
Justin Erenkrantz
929eb45aaf Fix incorrectly served 304 responses when expired cache entity
is valid, but cache is unwritable and headers cannot be updated.

Submitted by: Colm MacCarthaigh <colm stdlib.net>
Reviewed by: Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@231488 13f79535-47bb-0310-9956-ffa450edef68
2005-08-11 17:38:18 +00:00
Justin Erenkrantz
d757d824b8 mod_cache: Implement remove URL via a filter.
Remove entities from the cache when re-validation receives a 404 or other
content-no-longer-present error.

Suggested by: Paul Querna, Justin Erenkrantz
Submitted by: Rudiger Plum <ruediger.pluem vodafone.com>
Reviewed by: Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@231487 13f79535-47bb-0310-9956-ffa450edef68
2005-08-11 17:35:48 +00:00
Justin Erenkrantz
a992d08b42 Implement mod_disk_cache's remove_url.
(Minor tweaks and comment fixes by Justin.)

Suggested by: Paul Querna, Justin Erenkrantz
Submitted by: Rudiger Plum <ruediger.pluem vodafone.com>
Reviewed by: Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@231486 13f79535-47bb-0310-9956-ffa450edef68
2005-08-11 17:31:10 +00:00
Justin Erenkrantz
d971ca4ef8 mod_disk_cache: Retry file rename up to three times to ameliorate race
condition with htcacheclean removing the directories underneath us.

(Includes tweaks by Justin.)

Suggested by: Graham Leggett
Submitted by: Andreas Steinmetz <ast@domdv.de>
Reviewed by: Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@231349 13f79535-47bb-0310-9956-ffa450edef68
2005-08-10 23:03:38 +00:00
Paul Querna
f4b3ad20aa Opps. Use the correct member of the structure.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@220038 13f79535-47bb-0310-9956-ffa450edef68
2005-07-21 11:40:30 +00:00
Paul Querna
f00dcbee2e Correctly restore the HTTP status from the cache handler.
Submitted by: Hansjoerg Pehofer


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@220036 13f79535-47bb-0310-9956-ffa450edef68
2005-07-21 11:37:07 +00:00
Paul Querna
01d65f9f59 Quick hack to store varied contents under the same path, making it
easier for admins to manage the cache.

Still requires modifications to htcacheclean to work.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@219945 13f79535-47bb-0310-9956-ffa450edef68
2005-07-20 16:56:23 +00:00
Paul Querna
7d836630f7 Now you can run mod_deflate before mod_cache, and cache it.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@219913 13f79535-47bb-0310-9956-ffa450edef68
2005-07-20 14:35:21 +00:00
William A. Rowe Jr
2e3f62d979 caddr_t is quite non-portable, but a (void*) will do the trick.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@191174 13f79535-47bb-0310-9956-ffa450edef68
2005-06-17 16:27:58 +00:00
Bradley Nicholes
a5930f73ee Fix up some type mismatches that are causing compiler errors in Metrowerks on NetWare
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@190819 13f79535-47bb-0310-9956-ffa450edef68
2005-06-15 21:37:10 +00:00
Paul Querna
13424c5f6e - Remove unneeded cast.
Reported by: Garrett Rooney


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@190547 13f79535-47bb-0310-9956-ffa450edef68
2005-06-14 01:50:27 +00:00
Paul Querna
d4293052e2 - Partial revert of revision 190535. Remove const from tempfile, since apr_file_mktemp() requires it.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@190536 13f79535-47bb-0310-9956-ffa450edef68
2005-06-14 00:23:13 +00:00
Paul Querna
e54924f2ac * cache/mod_disk_cache.c: Make most members of disk_cache_object into const char*. This removes the need to cast the const out in several places.
* cache/mod_cache.h: Make cache_object.key a const.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@190535 13f79535-47bb-0310-9956-ffa450edef68
2005-06-14 00:16:48 +00:00
Paul Querna
605cba8fa8 - Remove unused dirlevels and dirlength from the cache info structure.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@190534 13f79535-47bb-0310-9956-ffa450edef68
2005-06-14 00:08:09 +00:00
Paul Querna
e4ef99743c Based on feedback from dev@httpd, store Vary headers inside the '.header' file.
These Vary headers are used to build a new hash for a URL, based on the 
client's headers.  This allows mod_disk_cache to store many variations of one 
URI, where previously it would only store a single variant.

htcacheclean needs to be updated to understand the new file format.  I plan on 
updating htcacheclean in the next couple days.

PR: 35211


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@190530 13f79535-47bb-0310-9956-ffa450edef68
2005-06-13 23:17:52 +00:00
Paul Querna
4ae5658935 - link/unlink are not called directly, so we do not need this extra header.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@190047 13f79535-47bb-0310-9956-ffa450edef68
2005-06-11 00:33:48 +00:00
Paul Querna
0d46d695a2 - Use apr_file_mktemp() and rename the header data file to its final location, instead of opening it and then writing it out as we go. Should prevent race conditions on busy servers.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@190043 13f79535-47bb-0310-9956-ffa450edef68
2005-06-11 00:26:19 +00:00
Paul Querna
947ce2408d * cache_save_filter:
*) Remove the first set of Validation code.  Use the main if structure to check for both 'Vary: *' and 'Cache-Control: no-store'.
    *) Add logging of failures for a provider's store_body function.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@190033 13f79535-47bb-0310-9956-ffa450edef68
2005-06-10 23:02:26 +00:00
Bradley Nicholes
721efba284 Rename generate_name to ap_cache_generate_name
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@189661 13f79535-47bb-0310-9956-ffa450edef68
2005-06-08 22:09:52 +00:00
Paul Querna
222d82ef5c * mod_cache.c: When 'Vary: *' is sent, do not cache, since revalidation is always required.
PR: 16125


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@180341 13f79535-47bb-0310-9956-ffa450edef68
2005-06-06 16:53:15 +00:00
Paul Querna
85015ced14 'generate_name' is too generic to be in the public symbols. Rename it to ap_cache_generate_name. No functional changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@179877 13f79535-47bb-0310-9956-ffa450edef68
2005-06-03 20:19:08 +00:00
William A. Rowe Jr
20d06d7a06 Reintroduce stack frame construction with /Oy- (removal was implied by /O2).
This makes binaries far easier to debug, during operation and for post-crash
  .dmp analysis.  Do not alter /Gs optimizations per brane.

Reviewed by: stoddard, brane

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@170253 13f79535-47bb-0310-9956-ffa450edef68
2005-05-15 19:11:57 +00:00
Sander Striker
97851ed800 Another mod_cache fixlet.
* modules/cache/mod_cache.c

  (cache_url_handler): Add more debug output.  Restore original request
   headers when CACHE_SAVE filter isn't added to fix up after the request.


* modules/cache/cache_storage.c

  (cache_select_url): Add more debug output.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@157162 13f79535-47bb-0310-9956-ffa450edef68
2005-03-11 21:39:45 +00:00
Sander Striker
7402943941 Make IgnoreCacheControl do what it implies when it comes to requests and
freshness checks.

* modules/cache/cache_util.c

  (ap_cache_check_freshness): Ignore CacheControl: max-age and min-fresh
   if IgnoreCacheControl is set.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@156567 13f79535-47bb-0310-9956-ffa450edef68
2005-03-08 21:11:07 +00:00
Sander Striker
f92cbd8dbc Improve caching a bit more...
* modules/cache/cache_util.c

  (ap_cache_check_freshness): On Cache-Control/Pragma no-cache force
   revalidation by marking the resource as stale.  Unless IgnoreCacheControl
   is set ofcourse.

 
* modules/cache/mod_cache.c

  (cache_url_handler): Remove Cache-Control/Pragma no-cache check and
   accompagnying comment.

  (cache_save_filter): Move FIXME comment to the correct location.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@156480 13f79535-47bb-0310-9956-ffa450edef68
2005-03-08 02:35:50 +00:00
Sander Striker
c8c8263f9c Remove an unused function.
* cache_util.c
* mod_cache.imp
* mod_cache.h

  (ap_cache_request_is_conditional): Removed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@156471 13f79535-47bb-0310-9956-ffa450edef68
2005-03-08 01:34:32 +00:00
Justin Erenkrantz
a32a693014 * modules/cache/cache_util.c (ap_cache_check_freshness): Use r->headers_in not
the stored headers for the Cache-Control check.

Pointed out by: Sander Striker


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@156401 13f79535-47bb-0310-9956-ffa450edef68
2005-03-07 07:18:34 +00:00
Sander Striker
c70cb4ba14 More mod_cache tweakage...
* modules/cache/mod_cache.c

  (cache_save_filter): Instead of unconditionally returning a 304 when
   the original request was conditional and we issued a cache revalidating
   request, handle the request as if it came in while our cache was
   still valid.


* modules/cache/cache_storage.c

  (cache_select_url): Strip off the conditional headers from the original
   request, prior to adding our own for the purpose of revalidating our
   cached response.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@156330 13f79535-47bb-0310-9956-ffa450edef68
2005-03-06 18:57:22 +00:00
Sander Striker
438c65986e Tracked down by Justin Erenkrantz.
* modules/cache/mod_disk_cache.c

  (store_headers): Stop second guessing mod_cache and just store the
   headers in a new file (overwriting the old).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@156306 13f79535-47bb-0310-9956-ffa450edef68
2005-03-06 12:52:46 +00:00
Sander Striker
11344ad83a * modules/cache/mod_cache.c
(cache_url_handler): Tweak a few comments.

  (cache_save_filter): Add a FIXME for a corner case.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@156304 13f79535-47bb-0310-9956-ffa450edef68
2005-03-06 12:43:42 +00:00
Joe Orton
519b48fce1 * modules/cache/mod_disk_cache.c (store_body): Fix format string
warnings; print integers using _FMT strings.

* modules/cache/cache_util.c (ap_cache_check_freshness): Remove unused
variable.

* modules/cache/cache_storage.c (cache_select_url): Remove unused
variable.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153385 13f79535-47bb-0310-9956-ffa450edef68
2005-02-11 12:16:06 +00:00
Sander Striker
c4afdce3fd Some minimal tweaks to mod_cache.
* modules/cache/mod_mem_cache.c

  (store_headers): Remove unused variable.


* modules/cache/mod_cache.c

  (cache_save_filter): Slightly improve comment.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153104 13f79535-47bb-0310-9956-ffa450edef68
2005-02-09 18:56:41 +00:00
Justin Erenkrantz
441086ecfd More work to properly handle revalidated responses correctly.
* modules/cache/mod_cache.c: If we add a new Expires value, tell our client;
  merge in headers properly (or better than before) so that we can update the
  header fields on a revalidated but with updated header fields.
* modules/cache/mod_cache.h, modules/cache/cache_storage.c:
  Add preserve_orig flag to ap_cache_accept_headers to allow updating of fields.
* modules/cache/mod_disk_cache.c: Load status value from disk.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@152973 13f79535-47bb-0310-9956-ffa450edef68
2005-02-09 01:38:59 +00:00
Sander Striker
876ee19013 More mod_cache tweakage.
* modules/cache/cache_storage.c

  (cache_select_url): Add If-Modified-Since regardless of having
    an ETag or not.  See: RFC2616, 14.26.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@152948 13f79535-47bb-0310-9956-ffa450edef68
2005-02-08 22:23:31 +00:00
Bradley Nicholes
f193418fa8 Make the function declaration match the prototype
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@152927 13f79535-47bb-0310-9956-ffa450edef68
2005-02-08 19:41:15 +00:00
Justin Erenkrantz
74a70d429a Return the proper status and headers when serving a revalidated response.
* modules/cache/mod_cache.c
  (cache_save_filter): Load in the cached status and headers; send a flush
  rather than an EOS when the client request is conditional.
* modules/cache/mod_cache.h: Export ap_cache_accept_headers.
* modules/cache/cache_storage.c: Rename accept_headers to
  ap_cache_accept_headers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@152680 13f79535-47bb-0310-9956-ffa450edef68
2005-02-08 17:56:38 +00:00
Justin Erenkrantz
1d4c6d1c6d Cleanup structures in mod_cache and friends to remove unused or unnecessary
fields.  Also resolves a number of latent bugs due to the wrong fields being
accessed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@152679 13f79535-47bb-0310-9956-ffa450edef68
2005-02-08 17:39:56 +00:00
Justin Erenkrantz
1e352ba28e * modules/cache/mod_cache.h: Move the structure declaration of cache_handle
near its typedef declaration.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151817 13f79535-47bb-0310-9956-ffa450edef68
2005-02-08 02:05:05 +00:00
Justin Erenkrantz
268fba842f * modules/cache/mod_cache.c: One more try at proper handling of revalidated
responses.

...All together now, we hate uninitialized variables...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151816 13f79535-47bb-0310-9956-ffa450edef68
2005-02-08 02:03:47 +00:00