1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-05 05:30:39 +03:00
Commit Graph

122 Commits

Author SHA1 Message Date
Stefan Fritsch
aa576071af - Remove a load of unused variables (or variables that are set but never read).
- Move some declarations into the correct #ifdef scope.

I couldn't compile/test netware, but the changes look obvious enough.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982016 13f79535-47bb-0310-9956-ffa450edef68
2010-08-03 19:45:21 +00:00
Graham Leggett
a71d310a23 mod_cache: Explicitly allow cache implementations to cache a 206 Partial
Response if they so choose to do so. Previously an attempt to cache a 206
was arbitrarily allowed if the response contained an Expires or
Cache-Control header, and arbitrarily denied if both headers were missing.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@952823 13f79535-47bb-0310-9956-ffa450edef68
2010-06-08 21:13:06 +00:00
Stefan Fritsch
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
Graham Leggett
2e958275d9 Fix a bug where if the cache quick handler is switched off, and the CACHE
filter is manually added by the admin, but caching has not been enabled for
the URL space, an attempt is made to remove the CACHE_SAVE filter instead
of the CACHE filter. This fix makes the code work like the comment above
the code, the comment being correct.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951220 13f79535-47bb-0310-9956-ffa450edef68
2010-06-04 00:09:51 +00:00
Ruediger Pluem
8fa54a82f4 * Do NOT cache 206 responses in any case since we don't (yet) know how to
cache partial responses. Fixes regression of r724093.

PR: 49113


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@933919 13f79535-47bb-0310-9956-ffa450edef68
2010-04-14 12:00:11 +00:00
Jeff Trawick
93b1a9ca24 use ap_strchr_c to protect const-ness of input string
(and thus quiet gcc in maintainer mode)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832177 13f79535-47bb-0310-9956-ffa450edef68
2009-11-02 23:03:14 +00:00
Daniel Earl Poirier
17df062a0a mod_cache: add Cache-control: s-maxage to cacheability decisions per RFC 2616.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@823536 13f79535-47bb-0310-9956-ffa450edef68
2009-10-09 12:58:09 +00:00
Graham Leggett
ae50b75b92 mod_cache: Teach CacheEnable and CacheDisable to work from within a
Location section, in line with how ProxyPass works.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821993 13f79535-47bb-0310-9956-ffa450edef68
2009-10-05 20:27:19 +00:00
Daniel Earl Poirier
29a4d8a417 Back out r818492 which prevented all caching of incomplete responses.
Instead move the check to mod_disk_cache.  This leaves cache implementations
the flexibility to implement caching of incomplete responses.
PR: 15866


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821763 13f79535-47bb-0310-9956-ffa450edef68
2009-10-05 12:13:20 +00:00
Graham Leggett
f150bc9b04 Ensure that we call ap_meets_conditions() in the mod_cache normal handler
case, so that conditional requests are handled properly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821552 13f79535-47bb-0310-9956-ffa450edef68
2009-10-04 16:03:03 +00:00
Graham Leggett
f7ecd38d51 Remove an unused variable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821301 13f79535-47bb-0310-9956-ffa450edef68
2009-10-03 12:20:56 +00:00
Graham Leggett
3ae6189d47 mod_cache: Introduce the option to run the cache from within the
normal request handler, and to allow fine grained control over
where in the filter chain content is cached.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821202 13f79535-47bb-0310-9956-ffa450edef68
2009-10-02 23:47:37 +00:00
Ruediger Pluem
83fea47fea * Use strcasecmp instead of strncasecmp as we want to be sure that the whole
word is None and not only the beginning.

Noted by Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@819237 13f79535-47bb-0310-9956-ffa450edef68
2009-09-27 00:16:49 +00:00
Daniel Earl Poirier
546d17cd68 mod_cache: don't cache incomplete responses, per RFC 2616, 13.8.
PR: 15866


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@818492 13f79535-47bb-0310-9956-ffa450edef68
2009-09-24 14:25:19 +00:00
William A. Rowe Jr
1b68ef7771 Axe an unused variable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808724 13f79535-47bb-0310-9956-ffa450edef68
2009-08-28 01:32:18 +00:00
Graham Leggett
d3e08fa3ba Log the return code in the debug message to properly indicate why the lock
could not be obtained.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808652 13f79535-47bb-0310-9956-ffa450edef68
2009-08-27 21:47:26 +00:00
Graham Leggett
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
Graham Leggett
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
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