Search squid archive

Re: squid cache TCP_REFRESH_MODIFIED

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux