Re: [squid-users] About refresh_pattern

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Sat, 27 Jul 2013 18:16:25 +1200

On 27/07/2013 11:03 a.m., Ricardo Rios wrote:
> El 2013-07-25 21:30, Ricardo Rios escribió:
>
>>> On 26/07/2013 12:04 p.m., Ricardo Rios wrote:
>>>
>>>> Hi list, i am trying to cache some application exe files and updates
>>>> using refresh_pattern, when i check my regex at some online tool
>>>> tester, regex works great, but when i use it, i dont see anything
>>>> else then TCP_MISS/206 on my logs
>>> "206 Partial Content" means only a portaion of the object was received
>>> back from the server. Squid cannot cache these incomplete objects, so
>>> refresh_pattern is not relevant. You want "range_offset -1" to make
>>> Squid fetch the full object when the client requests any sub-portion
>>> like this. But be careful, this option applis to *all* requests and can
>>> cause Squid to fetch large amout fo data from the network which are
>>> never sent to any client (erasing the bandwidth saving benefits of the
>>> cache). Amos
>>
>> Ho i see, all the request have diff size, i dont noted that, thanks
>> Amos.
>
> I have 2 more questions about this, if all those updates i want to
> cache, are between 10 and 25 MB, i set range_offset_limit 26 MB and
> squid is going to download the files and give cache HITS ? even if the
> client only want a portion of the file ?

What happens depends on whether there *exist* any updates larger than
26MB, whether clients try to fetch portions of them past the 26MB limit,
and whether Squid already has an object in cache it can HIT on.

If Squid already has a cached object to HIT on range_offset_limit is
never even used. The client will simply get its Range response generated
as requested from the HIT object.

Any Range request under the limit gets converted to a full-object GET
request (no Range headers) when sent by Squid to the server. The client
will get its Range response generated as requested from the reply the
server sends back.

Any request for Ranges above the limit will be passed on untouched by
Squid. The reply is passed back to the client without being cached.

Either way the Squid<->Client traffic gets optimized down to a Range
request and Range reply.

>
> Second question, can i set range_offset_limit before the
> refresh_pattern for those updates, then at the end of those
> refresh_pattern i set range_offset_limit 0 for the rest ?

range_offset_limit and refresh_pattern are completely separate
operations and not related.

==> To make range_offset_limit to apply only on some traffic you require
a minimum of Squid-3.2 and some ACLs to specify which requests each
limit line applies to. Any range_offset_limit line without ACLs will
become the default - no range_offset_limit below it will be used, if all
range_offset_limit lines have ACLs the default is 0.

Amos
Received on Sat Jul 27 2013 - 06:16:33 MDT

This archive was generated by hypermail 2.2.0 : Sat Jul 27 2013 - 12:00:19 MDT