httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <>
Subject Re: mod_cache: Content Generation Dependencies?
Date Tue, 26 Oct 2004 02:32:31 GMT
Paul Querna wrote:

> I have been doing some stuff with mod_transform (XSLT processor) and 
> mod_cache.
> The problem is, mod_cache doesn't have any easy way to know if a request 
> needs to be regenerated.  Right now, it just blindly caches until a 
> timeout.  What I would prefer is that it knows what files or URLs a 
> specific request depends upon, and if any of those change, then 
> regenerate the request.
> An example:
> cache_add_depends(r, "/home/httpd/site/xsl/foo.xsl");
> This would add 'foo.xsl' as a dependency of the current request.  If the 
> file's mtime changes, mod_cache would invalidate the cache of the 
> current request.
> Any opinions or suggestions?
> A stat() call on several files is hundreds of times faster than having 
> mod_transform re-generate the output.  While I would hate to stat() 
> hundreds of files on every request, this method could eliminate all 
> unesesary regeneration of cached content.

The cache has no knowledge about underlying files, never mind multiple 
dependancies. It relies on HTTP/1.1 to work out cache freshness.

Dependancies should be tracked by mod_transform not mod_cache - if 
either the source file, or XSL file changes, then the Etag should 
change, which will signal mod_cache (and any other caching proxies along 
the way) that the content is no longer fresh.

If mod_transform isn't supporting Etag properly, then I'd say 
mod_transform was broken, and fixing it would probably solve your problem.


View raw message