Re: [squid-users] Re: Squid Reverse Proxy (accel) always contacting the server

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 03 Apr 2012 00:40:59 +1200

On 2/04/2012 8:05 p.m., Daniele Segato wrote:
> On 04/02/2012 03:22 AM, Amos Jeffries wrote:
>>> Last-Modified: <date here, should change when the content change>
>>> Cache-Control: public, max-age=60
>>>
>>> 60 = 60 seconds, means: squid please do not bother the server for 60
>>> seconds after this reply, even if they ask for "If-Modified-Since"
>>
>> Small correction: means don't ask again until 60 seconds from
>> Last-Modified. If Last-Modified is missing or invalid, 60 seconds from
>> Date:.
>
>
> that's not what I've seen
>
> I returned Last-Modified (very old), Date: "now" and max-age: 60
>
> squid3 is not checking the server again for 1 minute, then when it
> does it keep replying without checking the server for another 1 minute
> and so on.
>
> Is it because I specified Age: 0 and Date now?

Possibly. there are a few bugs still in Squids HTTP/1.1 compliance. You
may have lucked out and hit one :)

>
>>> I also added Age: 0 (i tell squid that I'm providing a fresh content).
>>> And Date: with the current date, I think this also tells squid the
>>> content is fresh
>>> not sure those are needed but probably helps.
>>
>> Tells when the response was generated, in case of transfer delays. Acts
>> as a backup for Last-Modified as above, and a value to synchronise
>> Expires: comparisons between proxies and servers despite any clock
>> difference problems.
>
> My server return Age:0 and Date: "now" that should do right?

Since it works sure. Technically Age is a header only sent by caches,
not origin servers. Things are a bit convoluted when its present.

>
>
>>> On the squid size I configured the refresh_pattern <regex> 0 20% 4320
>>>
>>> without adding any other option, this was perfectly fine.
>>
>> refresh_pattern provides default values for max-age / min-age and next
>> revalidate time if none are provided by the combination of cache control
>> headers discussed above. When Expires: or Cache-Control: are sent
>> refresh_pattern value is not used.
>
> In the log it say:
> 2012/04/02 07:35:47.326| refreshCheck: Matched
> '/alfresco/service/stream 0 20%% 259200'
>
> are you saying this is ignored?
>
> I tried by setting that rule with 0 %20 0 and I had all TCP_MISS
>
> so apparently the rule "win" against the http headers.
>
> or maybe I misunderstood you :)

Seems to be a bug or a case of min(refresh_pattern max-age, headers
max-age) I overlooked.

Amos
Received on Mon Apr 02 2012 - 12:41:03 MDT

This archive was generated by hypermail 2.2.0 : Mon Apr 02 2012 - 12:00:02 MDT