Search squid archive

Re: Caching based on header/etag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21/05/2014 3:43 a.m., Tom Holder wrote:
> Hi all,
> 
> I've setup squid to proxy everything to a single server I have.
> 
> Based on a header, I might want to serve a different version of a file
> for example for:
> 
> X-MY-HEADER: 1
> URL: /css/style.css
> 
> Would not be the same as:
> 
> X-MY-HEADER: 2
> URL: /css/style.css
> 
> Ideally though I'd like to be able to cache both.
> 
> Can I get squid to somehow differentiate based on an incoming header?
> 
> Failing that, I'm generating an etag on the server that's a hash of
> the content. Will this be enough to distinguish between the different
> files?

Not by itself. ETag is used to confirm correct variant is being
revalidated or fetched once one is chosen.

You need the server to emit "Vary: X-MY-HEADER" on all responses to
enable Squid to perform the initial selection.

Between them Vary, ETag and Last-Modified permit Squid to target a
specific object variant inside the set of possible responses to any
dynamic resource URL.

Amos





[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux