You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Leif Hedstrom <zw...@apache.org> on 2011/11/01 16:09:30 UTC

Re: Trying to understand caching inconsistency with dynamic URLs (or cookies)

On 11/01/2011 12:19 AM, Henry C. wrote:
> On Mon, October 31, 2011 23:30, Leif Hedstrom wrote:
>> Well, if you vary: on user-agent, you are almost guaranteed to get a
>> craptacular cache hit ratio. There are thousands (if not 10's of thousands) of
>> variations of User-Agents. It's a real bad idea to vary: on it if you want any
>> sort of cache hit ratio :).
>>
>> I'm stuck doing $work for a while, so haven't had time to get back on
>> mailing lists activities, but just wanted to toss this one in here quickly.
> Thanks Leif - correct me if I'm wrong:  when using a reverse proxy for the
> acceleration benefits, one would think it's a reasonable expectation that
> common objects will be served from the cache to anyone, willy-nilly,
> irrespective of their stupid user-agent string, IP or whether their left cheek
> is rubbing against their right.

Why would you make that assumption? If the origin says that it varies 
the content based on the User-Agent header (or any other header), the 
intermediary (proxy) has no other choice but to try to keep one version 
for every possible string. How else could it work? Intermediaries have 
no way of knowing that even if your origin lies and says Vary: 
User-Agent, it can ignore it. If that is the case, you really (*really*) 
have to modify your origin, not the intermediary.

Just to be clear, the issue is not the User-Agent string, it's that your 
Origin (it seems?) sends a Vary: on these "willy-nilly" headers.

>
> Otherwise, what's the point?

The point is that you have to obey the protocol, if not, you are very, 
very likely to give the wrong document to the users.

-- Leif