You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Pier Fumagalli <pi...@betaversion.org> on 2004/02/01 02:30:56 UTC

Small patch to mod_disk_cache...

I found a small bug in mod_disk_cache...

CacheMinFileSize and CacheMaxFileSize process the argument with atoi(), 
which simply means that they'll get -1 if the value is quite large (I 
need to cache some big files)...

At the same time, I added a small feature I needed: the ability to 
cache content from sources where content-length is not specified 
(namely, friggin' JSPs).

This patch encloses both changes...

	Pier


Re: Small patch to mod_disk_cache...

Posted by Martin Kraemer <ma...@apache.org>.
On Sun, Feb 01, 2004 at 01:30:56AM +0000, Pier Fumagalli wrote:
> I found a small bug in mod_disk_cache...
> 
> CacheMinFileSize and CacheMaxFileSize process the argument with atoi(), 
> which simply means that they'll get -1 if the value is quite large (I 
> need to cache some big files)...
> 
> At the same time, I added a small feature I needed: the ability to 
> cache content from sources where content-length is not specified 
> (namely, friggin' JSPs).

Strange that you found that at the same time as I did. Your patch is
missing the following:

* it must check CacheMinFileSize and CacheMaxFileSize when the
  response is complete. That may mean that we are checking at two places:
  -> when the C-L is known, we check before we cache
  -> when it is unknown we check "on-the-way" for CacheMaxFileSize, and
     after caching completion for CacheMinFileSize

* it *may* compare the actual size of the cached copy against the C-L
  header, and discard it if the two don't match

Also, in spite of RFC2616 14.8, we currently *never* cache
authenticated responses, even if the RFC would allow for it.
The auth check can be taken out of mod_cache,
the check in mod_disk_cache replaces it (but I have not checked
whether mod_mem_cache checks auth as well -- it should, or mod_cache
should try and analyze the headers_out as well).

The patch (completely independent from yours) tries to address that.
IMO the two should be merged (I am on my way home, so I'm not doing
the merge right now). 

   Martin
-- 
<Ma...@Fujitsu-Siemens.com>         |     Fujitsu Siemens
Fon: +49-89-636-46021, FAX: +49-89-636-47655 | 81730  Munich,  Germany