[squid-users] Caching based on header/etag

Eliezer Croitoru eliezer at ngtech.co.il
Thu Dec 11 14:04:00 UTC 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If you have access to the apache server it's very simple to remove the
headers.

I do have a question about the docs:
http://www.squid-cache.org/Versions/v3/3.4/cfgman/reply_header_access.html

Will the reply_header_access will affect the stored cache object?
If so or not what suppose to happen?

Thanks,
Eliezer

On 05/20/2014 07:51 PM, Amos Jeffries wrote:
> 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
> 


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJUiaRQAAoJENxnfXtQ8ZQUMTEH/3eoeTvOjVoa0HpM/HGxcEc/
BMdU0ODhYcxhShPckXK/WJJ7D6ihyI9srKZkAAt1msiDELsTMgLJwKg0er1Uf6fp
pzICv5hmlFviuyQkjzdoM6s1dhHVBUBSLMOI7KutxecC6FoGmGxWz/ModUWdeaGE
Na30IyAMgj3xdt2mtC/COv/SeEp3/n72Yqa9mrHToW3QiwqFhC2jYMXI7pTD88zl
qQHkFWbhHIby/miqHIETF13b4Ec/yLlcR+HwgCz08Lt8pbDktqLuu7TVYmg67XNF
3SeHQhJrv7vag44qz8jfU4BScKN3lEg7cEgd98DH1/Vivapxz55U1LNIFzC1wHc=
=ayHh
-----END PGP SIGNATURE-----


More information about the squid-users mailing list