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

From: Daniele Segato <daniele.segato_at_gmail.com>
Date: Sat, 31 Mar 2012 17:53:10 +0200

On 03/31/2012 05:01 PM, Daniele Segato wrote:
> On 03/31/2012 10:13 AM, Amos Jeffries wrote:
>> max-age
>>
>> The max-age response directive indicates that the response is to
>> be considered stale after its age is greater than the specified
>> number of seconds.
>>
>> "
>>
>> The logic goes like this:
>>
>> Object modified ... 22:14:20
>> Valid +3600
>> ==> fresh until 23:14:50
>> Current time: 23:27:57
>>
>> 23:14:50 < 23:27:15 ==> currently stale. must revalidate.
>>
>> Expires header can be used to set an absolute time for invaldation.
>> max-age is relative to age.

Ok I think I now understood you...

> you are saying that max-age is added to "last modified date"
> but that doesn't make much sense to me.
>
> If the server (parent cache) is returning the content at 23:27:00 saying
> max-age 3600 I would expect that 3600 start from "now".

> anyway, I thought about this before and I also tried to modify the
> content, then immediately giving two request to squid.

apparently this was caused by a mistake I did with the server (see below)

> this time, suppose:
>
> Object modified ... 00:00:00
> Valid +3600
> ==> fresh until 01:01:00
> Current time: 00:05:00
>
> 01:01:00 > 00:05:00 ==> currently fresh. shouldn't bother the server.
>
> instead what's actually happening is that squid is doing a request to my
> server, only header, but it's still doing it.
>
> My server, to compute the "Last-Modified" date has to do all the job of
> collecting the data, looping to each data element and extract, for each,
> the last modified date, then compute the "last one".. it build a "model"
> that is then rendered: it's pretty short anyway since it's gzipped text.
>
> So the big work of my server is to collect the data, and my server have
> to do it both if you do a GET both if you do an HEAD request.
>
> I would like squid to revalidate with my server every, say 1 minute,
> even 10 seconds is ok.. but it shouldn't revalidate every single request
> it is receiving.
>
> I hope I made my point.

this question is still in place :)

> I wanted to give you an example but now squid is always giving me a
> TCP_MISS

this was my mistake, the Last-Modified date format was wrong from server :)

please ignore the debug and everything behind this point in my previous
email...

Now it's giving cache hits in ram!

I think I can summarize my question in this two questions:
1) can I make squid3 update the cache with my server every, say, 1
minute (at most) but use it's cache otherwise without bothering the
server (not even for headers)? how?

Avoiding to call the server for 1 hour, I think, it's a bit too much:
the content can change in the meanwhile and I don't want the user to
wait 1 hour for it.

On the other part I don't want every single request after that hour is
pass to see squid contacting my server to check if the last modified
date is changed.

2) which is the best way to debug why squid3 is deciding to keep a cache
entry, contact the server or not? looking at the huge debug log is not
very simple maybe some log option to filter it with the cache decisions
informations only would help

Thanks and sorry for the previous message
Received on Sat Mar 31 2012 - 15:48:59 MDT

This archive was generated by hypermail 2.2.0 : Sun Apr 01 2012 - 12:00:04 MDT