You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Deve Loper <at...@gmail.com> on 2012/10/08 19:17:42 UTC

Cache alternates

Hy,

We are deploying TrafficSever in our network and encounter the following
problem:
The file is being stored in the cache three times due to the request header
being different (performed by different browsers).
Even by setting the contents of the variable
proxy.config.cache.limits.http.max_alts to 1, the file is still being saved
several times to leave the cache oh yes.
How can I solve this problem?

Thanks,
VWN Company.

Re: Cache alternates

Posted by Deve Loper <at...@gmail.com>.
Hy,

The problem was solved by removing the Vary header field.

Thanks everyone for the input.
VWN Company

Re: Cache alternates

Posted by Leif Hedstrom <zw...@apache.org>.
On 10/8/12 11:57 AM, Deve Loper wrote:
> Yes,
>
> When the User-Agent varies it is saved again in disk.
> Is there any possibility of eliminating it?
>


If you control the Origin server, make it stop behaving stupidly. If you 
don't, well, then you can strip off the Vary: header via a plugin. This 
feels like the wrong approach though, and potentially could break the 
site (if e.g. the origin truly varies the content based on the 
user-agent). If at all possible, fix your origin server, and Vary: on 
something with less entropy.

-- Leif


Re: Cache alternates

Posted by Reindl Harald <h....@thelounge.net>.

Am 08.10.2012 19:57, schrieb Deve Loper:
> When the User-Agent varies it is saved again in disk.
> Is there any possibility of eliminating it?

yes, simply eliminate it on the ORIGIN-server

you probably did not understand the meaning of "vary" in the contect
HTTP-Header of the origin-server

Vary: User-Agent
do not send it if you do not want

<IfModule mod_headers.c>
 Header append Vary User-Agent
 <FilesMatch
"\.(gif|jpe?g|png|css|js|ico|flv|mp4|m4v|wmv|mov|mpg|ogv|webm|mp3|wav|ogg|oga|swf|doc|docx|xls|xlsx|pdf)$">
  Header unset Vary
 </FilesMatch>
 <FilesMatch "\.(css|js|htc|wav|doc|docx|xls|xlsx|pdf)$">
  Header set Vary "Accept-Encoding"
 </FilesMatch>
</IfModule>




Re: Cache alternates

Posted by Deve Loper <at...@gmail.com>.
Yes,

When the User-Agent varies it is saved again in disk.
Is there any possibility of eliminating it?

Thanks,
VWN Company

Re: Cache alternates

Posted by Eric Balsa <er...@ericbalsa.com>.
Is the origin Varying on the User-Agent?

--Eric

On Mon, Oct 8, 2012 at 11:17 AM, Deve Loper <at...@gmail.com> wrote:
> Hy,
>
> We are deploying TrafficSever in our network and encounter the following
> problem:
> The file is being stored in the cache three times due to the request header
> being different (performed by different browsers).
> Even by setting the contents of the variable
> proxy.config.cache.limits.http.max_alts to 1, the file is still being saved
> several times to leave the cache oh yes.
> How can I solve this problem?
>
> Thanks,
> VWN Company.