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

54 Commits

Author SHA1 Message Date
Ruediger Pluem
cfc67db148 * Use the correct constant.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@778438 13f79535-47bb-0310-9956-ffa450edef68
2009-05-25 15:19:51 +00:00
Ruediger Pluem
d2700640cd * Add CacheIgnoreURLSessionIdentifiers directive to ignore
defined session identifiers encoded in the URL when caching.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@777042 13f79535-47bb-0310-9956-ffa450edef68
2009-05-21 10:42:54 +00:00
Eric Covener
940a2bccca look for 'no-cache' in subprocess_env to prevent the saving
of an otherwise cacheable response.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@729316 13f79535-47bb-0310-9956-ffa450edef68
2008-12-24 15:03:33 +00:00
Paul Querna
24f396ce76 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/trunk@724093 13f79535-47bb-0310-9956-ffa450edef68
2008-12-07 06:33:02 +00:00
Dirk-Willem van Gulik
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
Ruediger Pluem
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
Dirk-Willem van Gulik
aa35cf17c2 Centralize hop-by-hop header handling in the main mod_cache code. This change is a no-op -- i.e. we call the same code path as prior to the API renaming. However this is propably wrong; and we should have been cleansing the content-types all along
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649179 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 16:40:10 +00:00
Paul Querna
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
Ruediger Pluem
e858f16bfb * 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@636386 13f79535-47bb-0310-9956-ffa450edef68
2008-03-12 16:07:46 +00:00
Justin Erenkrantz
3019f9a87b mod_cache: Do not set Date or Expires when they are missing from the original
response or are invalid.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@539621 13f79535-47bb-0310-9956-ffa450edef68
2007-05-18 22:42:59 +00:00
Justin Erenkrantz
cd208845d6 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@539620 13f79535-47bb-0310-9956-ffa450edef68
2007-05-18 22:38:08 +00:00
Justin Erenkrantz
1b7508dd21 mod_cache: Let Cache-Control max-age set the expiration of the cached
representation if Expires is not set.

* modules/cache/mod_cache.c
  (cache_save_filter): If Cache-Control max-age is set and Expires isn't,
  let that value control our expiration.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@539063 13f79535-47bb-0310-9956-ffa450edef68
2007-05-17 18:25:13 +00:00
Justin Erenkrantz
35713c177f RFC 2616 13.2.1 calls out max-age as being a valid 'explicit expiration time',
so per Sec. 13.9 permit queries with just max-age instead of only Expires.

* modules/cache/mod_cache.c
  (cache_save_filter): Be closer to RFC 2616's intent for query arguments.
* CHANGES: Update.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@538807 13f79535-47bb-0310-9956-ffa450edef68
2007-05-17 05:43:18 +00:00
Ruediger Pluem
8a7fb4574c * 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@504183 13f79535-47bb-0310-9956-ffa450edef68
2007-02-06 15:55:50 +00:00
Graham Leggett
a9f530e317 This time from the top, with three part harmony AND feeling...
Revert the read-while-caching and large-file-crash fixes for mod_disk_cache,
ready to start again.

Reverted: r450105 r450188 r462571 r462601 r462696 r467655 r467684 r468044
r468373 r468409 r470455



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@502365 13f79535-47bb-0310-9956-ffa450edef68
2007-02-01 21:28:34 +00:00
Jeff Trawick
4a70a0e04d whitespace fix
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@483970 13f79535-47bb-0310-9956-ffa450edef68
2006-12-08 12:49:45 +00:00
Ruediger Pluem
e6a844c031 * 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@476625 13f79535-47bb-0310-9956-ffa450edef68
2006-11-18 22:17:33 +00:00
Graham Leggett
66d027d551 mod_cache: Pass the output filter stack through the store_body()
hook, giving each cache backend the ability to make a better
decision as to how it will allocate the tasks of writing to the
cache and writing to the network. Previously the write to the
cache task needed to be complete before the same brigade was
written to the network, and this caused timing and memory issues
on large cached files. This fix replaces the previous fix for
PR39380.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@468373 13f79535-47bb-0310-9956-ffa450edef68
2006-10-27 13:28:56 +00:00
Graham Leggett
78e8ee0cf7 Revert the splitting of buckets before they are handed to the cache providers,
a better way has been found to do this.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@468044 13f79535-47bb-0310-9956-ffa450edef68
2006-10-26 15:43:25 +00:00
Graham Leggett
cdff9049e5 Optimise the alternate case. Fail fast and stop splitting buckets if
store_body is no longer being called.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@467684 13f79535-47bb-0310-9956-ffa450edef68
2006-10-25 15:45:22 +00:00
Graham Leggett
48a692a9cd mod_cache: Fix an out of memory condition that occurs when the
cache tries to save huge files (greater than RAM). Buckets bigger
than a tuneable threshold are split into smaller buckets before
being passed to mod_disk_cache, etc. PR 39380


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@467655 13f79535-47bb-0310-9956-ffa450edef68
2006-10-25 13:44:47 +00:00
Graham Leggett
bc84099c0a mod_cache: Eliminate a bogus error in the log when a filter returns
AP_FILTER_ERROR.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@450453 13f79535-47bb-0310-9956-ffa450edef68
2006-09-27 14:21:26 +00:00
Graham Leggett
9f5dee0d2c Don't cache requests with a expires date in the past; 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@450055 13f79535-47bb-0310-9956-ffa450edef68
2006-09-26 14:12:36 +00:00
Ruediger Pluem
edfbb15c54 * 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@425787 13f79535-47bb-0310-9956-ffa450edef68
2006-07-26 17:33:38 +00:00
Roy T. Fielding
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
Colm MacCarthaigh
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
Ruediger Pluem
395b632269 * Add CacheMinExpire directive to set the minimum time in seconds to cache a document
in the case that no valid expire time was supplied with the document.

Submitted by: Brian Akins <brian.akins turner.com>
Reviewed by: Ruediger Pluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@369811 13f79535-47bb-0310-9956-ffa450edef68
2006-01-17 15:12:23 +00:00
Jim Jagielski
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Justin Erenkrantz
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00