Re: [squid-users] squid cache TCP_REFRESH_MODIFIED

From: parashuram <parashuram.l_at_accord-soft.com>
Date: Mon, 20 Feb 2012 14:50:26 +0530

On 2/20/2012 1:40 PM, Amos Jeffries wrote:
> On 20/02/2012 6:21 p.m., parashuram wrote:
>> On 2/18/2012 10:02 AM, Amos Jeffries wrote:
>>> On 18/02/2012 12:26 a.m., parashuram wrote:
>>>> Hi all,
>>>> I am using squid to cache dynamic responses from my particular server
>>>>
>>>> everything working fine,
>>>> When I make first request access.log has
>>>> 1329473470.110 0 192.168.0.40 TCP_MISS/200 856 GET
>>>> http://[ipv6address]:8080/.well-known/core - DIRECT/::1 text/html
>>>>
>>>> Next request it logs following
>>>> 1329473479.050 0 192.168.0.40 TCP_REFRESH_MODIFIED/200 856 GET
>>>> http://[ipv6address]:8080/.well-known/core - DIRECT/::1 text/html
>>>>
>>>> request is in cache but due to resources being changed response is
>>>> from origin server( I've ignored must revalidated in refresh
>>>> pattern). I wanted request should be served from cache even if its
>>>> modified and log TCP_HIT or TCP_MEM_HIT in access.log.
>>>> any idea what might be going wrong??? suggestion how to tell squid
>>>> not send revalidiate signal to origin server to cross check for
>>>> resource modification???
>>>>
>>>> server header response is as follows
>>>>
>>>> (Status-Line) HTTP/1.0 200 OK
>>>> Date Fri, 17 Feb 2012 10:11:19 GMT
>>>> Content-Type text/html
>>>> Last-Modified Wed, 15 Feb 2012 07:48:34 GMT
>>>> Accept-Ranges bytes
>>>> Content-Lenght 8334
>>>> Cache-Control max-age=86400,public
>>>
>>> Notice how "must-revalidate" is not present. Your override turing it
>>> off does nothing.
>>>
>>> What is happening here is that max-age is specifying that the object
>>> is stale when older than 1 day, and needs revalidatating. (Date
>>> minus Last-Modified) is stating that it is currently 2 days old.
>> Thanks for reply, Now current Header is a follows
>>
>> (Status-Line) HTTP/1.0 200 OK
>> Date Mon, 20 Feb 2012 04:39:10 GMT
>> Content-Type text/html
>> Last-Modified Mon ,20 Feb 2012 04:29:10 GMT
>> Accept-Ranges bytes
>> Content-Lenght 8334
>> Cache-Control max-age=86400,public
>> Expires Tue, 21 Feb 2012 04:29:10 GMT
>> X-Cache MISS from colinux
>> Via 1.0 colinux (squid/3.1.18)
>> Connection close
>>
>> But still it logs as TCP_REFRESH_MODIFIED for my server, but other
>> web pages (i.e www.squid-cache.org ) showing TCP_MEM_HIT with same
>> response header.
>
> Servers such as squid-cache.org respond with a 304 (Not Modified)
> status to If-Modified-Since requests when the requested object has not
> changed. Allowing Squid to serve its cached copy (HIT).
>
> The reason you are getting "MODIFIED" is that the server is sending
> back a 2xx status with new data.
>
>
>>> Squid is only performing a REFRESH (if-modified-since) check, this
>>> is very efficient if the server supports
>> Is it possible to disable REFRESH(if-modified-since) check. ?? if so
>> how??
>
> You either remove the max-age control and depend on Expires alone. Or
> extend max-age to be current age of the object + 86400 seconds each
> time a response is sent.
>
> The bigger problem is that the server is sending 200 instead of 304.
> You can extend the max-age and/or expires value using 304 responses
> with no body.
>
> Fix that and you will both save bandwidth and get something saying
> *REFRESH_HIT or *_REFRESH_UNMODIFIED (which is the same thing even if
> the letters "HIT" are not part of the label).
>
> Amos
>
Thanks Amos you rock,
I removed max-age,and now its showing TCP_MEM_HIT ( yuppie :) ).

-- 
Regards,
Parashuram
Systems Engineer
Accord Software&  systems Pvt Ltd
Division : GNSS&  Systems
www.accord-soft.com
Mobile   : +91-81471 93134
Extn     : 227
##############################################################################################################################################
The information transmitted is intended for the person or entity to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination, copying or other use of, or taking any action in reliance upon, this information by
persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete
the material from your system. Accord Software & Systems Pvt. Ltd. (ACCORD) is not responsible for any changes made to the material other
than those made by ACCORD or for the effect of the changes on the meaning of the material.
##############################################################################################################################################
Received on Mon Feb 20 2012 - 09:22:01 MST

This archive was generated by hypermail 2.2.0 : Mon Feb 20 2012 - 12:00:03 MST