Bill Stoddard wrote:

This is the area in which mod_cache is most broken. It does not handle vary at all, thus the content needs to be stored before it is touched by any filters. But that doesn't work either because some filters will not properly run when serving content out of a quick_handler (ie, they might rely on some special something happening in the fixups hook for instance). Can't recall any exact scenarios right off the top of my busy brain but I know they exist. Would be real good to get this fixed in 2.2


So, basically, we would need to parse Vary headers and, possibly, store mulitple versions of the same uri. The vary header should just be Header names.

Possible scenerio:

Serving cached content:

-  lookup uri in cache (via md5?).
-  check varies - a list of headers to vary on
- caculate new key (md5) based on uri and clients value of these headers
- lookup new uri in cache
- continue as normal

Caching an object:
-see if object has been cached before by looking up uri in cache
-do the Vary's match?
   -no, discard old entry(?) and create new uri entry
   -yes, generate new key based on client values
-continue as normal


Also, if there are no Vary's on an object, there is no second key/entry.

Sound reasonable?

The thing that sucks is if you vary on User-Agent. You wind up with a ton of entries per uri. I cheated in another modules by "varying" on an environmental variable. Kind of like this:

BrowserMatch ".*MSIE [1-3]|MSIE [1-5].*Mac.*|^Mozilla/[1-4].*Nav" no-gzip

and just "vary" on no-gzip (1 or 0), but this may be hard to do just using headers...

--
Brian Akins
Senior Systems Engineer
CNN Internet Technologies



Reply via email to