Re: mod_cache & forward proxy
On Wed, Mar 05, 2003 at 05:23:27PM -0500, Allan Edwards wrote: > > Also, anyone have a good reason why we can't remove these > lines and allow mod_cache to serve default welcome pages? > > /* DECLINE urls ending in / ??? EGP: why? */ > if (url[urllen-1] == '/') { > return DECLINED; > } > > Allan This isn't really a qualified comment as I haven't really contributed as a developper (yet), but I'd still like to share it with you: I've recently adapted the cache modules of a vanilla 2.0.44 source tree in order to enable reverse proxy caching for an important but slow performance site of ours that generates mostly static content with dynamically served pages. In the course of those changes (which include RFC violations) we also stumbled across the fact that URLs ending in / are not cached. We removed the corresponding lines - the change works fine so far and we cannot see a reason why it shouldn't be done, either. Cheers - Harry pgp0.pgp Description: PGP signature
Re: mod_cache & forward proxy
Paul J. Reder wrote: There is an entry in the STATUS file about adding regular expression support for CacheEnable/CacheDisable, wouldn't regular expressions provide this function and a whole lot more? That could be the next step, did I hear a volunteer step forward ;-)
Re: mod_cache & forward proxy
There is an entry in the STATUS file about adding regular expression support for CacheEnable/CacheDisable, wouldn't regular expressions provide this function and a whole lot more? Allan Edwards wrote: Currently "CachEnable foo / " will configure mod_cache to cache all forward proxy responses. Seems to me we want to be a little more granular than that. The following patch will enable the use of e.g. "CacheEnable foo http: " to signify that just HTTP content should be cached. It also will allow scoping to a particular server e.g. "CacheEnable foo http://CacheOnlyThisServer/ " which is useful for say a branch office proxy, where you want to cache content from just the corporate server. Does this sound like a good idea? It will of course break current forward proxy config files that are using "CacheEnable foo / ", but mod_cache *is* still experimental. Index: mod_cache.c === RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_cache.c,v retrieving revision 1.73 diff -u -d -b -r1.73 mod_cache.c --- mod_cache.c3 Feb 2003 17:52:59 -1.73 +++ mod_cache.c5 Mar 2003 18:52:13 - @@ -95,7 +95,7 @@ apr_uri_t uri = r->parsed_uri; char *url = r->unparsed_uri; apr_size_t urllen; -char *path = uri.path; +char *path = r->uri; const char *types; cache_info *info = NULL; cache_request_rec *cache; Also, anyone have a good reason why we can't remove these lines and allow mod_cache to serve default welcome pages? /* DECLINE urls ending in / ??? EGP: why? */ if (url[urllen-1] == '/') { return DECLINED; } Allan -- Paul J. Reder --- "The strength of the Constitution lies entirely in the determination of each citizen to defend it. Only if every single citizen feels duty bound to do his share in this defense are the constitutional rights secure." -- Albert Einstein
mod_cache & forward proxy
Currently "CachEnable foo / " will configure mod_cache to cache all forward proxy responses. Seems to me we want to be a little more granular than that. The following patch will enable the use of e.g. "CacheEnable foo http: " to signify that just HTTP content should be cached. It also will allow scoping to a particular server e.g. "CacheEnable foo http://CacheOnlyThisServer/ " which is useful for say a branch office proxy, where you want to cache content from just the corporate server. Does this sound like a good idea? It will of course break current forward proxy config files that are using "CacheEnable foo / ", but mod_cache *is* still experimental. Index: mod_cache.c === RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_cache.c,v retrieving revision 1.73 diff -u -d -b -r1.73 mod_cache.c --- mod_cache.c 3 Feb 2003 17:52:59 - 1.73 +++ mod_cache.c 5 Mar 2003 18:52:13 - @@ -95,7 +95,7 @@ apr_uri_t uri = r->parsed_uri; char *url = r->unparsed_uri; apr_size_t urllen; -char *path = uri.path; +char *path = r->uri; const char *types; cache_info *info = NULL; cache_request_rec *cache; Also, anyone have a good reason why we can't remove these lines and allow mod_cache to serve default welcome pages? /* DECLINE urls ending in / ??? EGP: why? */ if (url[urllen-1] == '/') { return DECLINED; } Allan