httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Querna <>
Subject Re: mod_disk_cache behaviour with Vary: header
Date Tue, 24 Jan 2006 22:28:08 GMT
Laurent Perez wrote:
> Hello
> I apologize for posting this to dev@httpd but I think my question is
> related to mod_cache module developers, that's why I'm using this
> list, after reading bugzilla and source code available on
> I'm having troubles whenever I want to use the Vary: header to let
> mod_cache (I'm using mod_disk_cache, together with mod_proxy on
> apache2.2.0-54, debian packages) handle cached variations based on
> that header.

Wait a minute. Are you using 2.2.0 or are you using 2.0.54?  AFAIK, 
Debian has not imported 2.2.xx at all yet.

> The header I vary on is User-Agent, and when several different agents
> hit the cache, I thought mod_cache would create a separate couple from
> .header + .data files for each and every cached request. What is
> happening is that mod_cache is correctly detecting the agent variation
> (LogLevel debug directive reports "Vary header mismatch" from
> cache_storage.c), but instead of creating a new hash couple on disk,
> it is always rewriting the same .header and .data files.
> This reduces interest of the Vary: header, because for example when
> two different agents hit mod_cache, the backend webapp proxied by
> mod_proxy is queried twice, because the resulting hash variation is
> stored in the same files, and not in four different files. Of course
> if the same agent hits the cache twice, with no other agent hit
> in-between, the correct cached response is obviously well served.
> Is it an intentional cache behaviour, for example to avoid too many
> files to be created from mod_disk_cache only because of multiple
> probable variations ? Or is it a bug/todo feature that's being still
> worked on ?

This was fixed in 2.2.0. Upgrade and rejoice :)

In 2.2.0, it uses a .vary directory, with the same base hash, and then 
all varied contents are re-hashed underneath that base <hash>.vary 
directory.  It gives you the correct behavior with varied contents.


View raw message