[squid-users] Duplicate Headers

Amos Jeffries squid3 at treenet.co.nz
Tue Nov 24 23:12:12 UTC 2015


On 25/11/2015 6:58 a.m., Benjamin Reed wrote:
> Any idea how my X-Cache, X-Cache-Lookup, and Via: headers are getting
> messed up on my accelerator configuration?
>
> Here's the output from a sample HEAD request:
>
>
http://paste.opennms.eu/?26c282e7abba631e#oqU/8pAmAUXHhMXPHhr9vWjJAA1FVcgn49W5BWO1vIs=
>

This is a forwarding loop of a slightly unusual kind:

When Squid received the request, it asked its peers who had ability to
reach the object. They all did (X-Cache-Lookup: HIT...), so it picked
the first responder and sent the request there.
Unfortunately the first responder was just another mirror, so when it
received that request ... it does exactly the same thing.

If any mirror sees itself as listed in the Via header it will reject the
request with fowarding loop error, and the mirror that sent the request
to it will move on to the next possible destination for it.

Eventually the origin will be reached. But possibly after having gone
through all mirrors or some large portion of them.


> The 4 systems are set up as cache peers to each other, with a parent
> host that contains all the upstream content.

Instead of "cache_peer_access X allow all" use:
  cache_peer_access X allow !mirrors

That will ensure that mirrors go to the origin for any request that was
received from another mirror. Mirrors will still be available as
alternative sources for clients sent requests.


PS. you can also remove the "cache allow all" line. It does nothing.

Amos



More information about the squid-users mailing list