Re: How squid caches some things

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 11 Oct 2005 00:51:07 +0200 (CEST)

On Tue, 11 Oct 2005, Evgeny Kotsuba wrote:

> 1128979352.320 470 127.0.0.1 TCP_REFRESH_HIT/200 341 GET
> http://u1386.48.spylog.com/cnt?p=1 evg NONE/- text/html [Host:
> u1386.48.spylog.com\r\nUser-Agent: Mozilla/5.0 (OS/2; U; Warp 4.5; en-US;
> rv:1.4.1) Gecko/20031121\r\nAccept:
> video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1\r\nAccept-Language:
> ru,en-us;q=0.7,en;q=0.3\r\nAccept-Encoding: gzip,deflate\r\nAccept-Charset:
> KOI8-R,utf-8;q=0.7,*;q=0.7\r\nKeep-Alive: 300\r\nProxy-Connection:
> keep-alive\r\nReferer:
> http://kubok.yandex.ru/regkubok_msk1/a18820af44d1c98777244f3e2da43ebb/?&1029.27724170637\r\nCookie:
> VISID=DQKCCBIWMIICOCZWTB\r\nProxy-Authorization: Basic
> ZXZnOjEyMw==\r\nPragma: no-cache\r\n] [HTTP/1.1 200 OK\r\nDate: Sun, 09 Oct
> 2005 12:12:13 GMT\r\nServer: Apache/1.3.6 (OS/2)
> rus/PL28.16\r\nLast-Modified: Wed, 11 Apr 2001 11:22:00 GMT\r\nETag:
> "10001a-2b-3ad43e58"\r\nAccept-Ranges: bytes\r\nContent-Length:
> 43\r\nKeep-Alive: timeout=15, max=100\r\nConnection:
> Keep-Alive\r\nContent-Type: image/gif\r\n\r]

Forced reload of the cache due to "Pragma: no-cache" request header.

> 1128979352.770 4920 127.0.0.1 TCP_MISS/200 9593 GET
> http://kubok.yandex.ru/regkubok_msk1/a18820af44d1c98777244f3e2da43ebb/?&1029.27724170637
> evg DIRECT/213.180.204.2 text/html [Host: kubok.yandex.ru\r\nUser-Agent:
> Mozilla/5.0 (OS/2; U; Warp 4.5; en-US; rv:1.4.1) Gecko/20031121\r\nAccept:
> text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1\r\nAccept-Language:
> ru,en-us;q=0.7,en;q=0.3\r\nAccept-Encoding: gzip,deflate\r\nAccept-Charset:
> KOI8-R,utf-8;q=0.7,*;q=0.7\r\nKeep-Alive: 300\r\nProxy-Connection:
> keep-alive\r\nCookie: mail_tag=yandex.ru; yandexuid=880632171062857853;
> yandex_login=\r\nProxy-Authorization: Basic ZXZnOjEyMw==\r\nPragma:
> no-cache\r\n] [HTTP/1.1 200 OK\r\nDate: Mon, 10 Oct 2005 21:22:28
> GMT\r\nServer: Apache/1.3.33 (Unix) mod_perl/1.29 PHP/4.4.0
> rus/PL30.20\r\nPragma: no-cache\r\nCache-control: no-cache\r\nSet-Cookie:
> \r\nConnection: close\r\nContent-Type: text/html;
> charset=windows-1251\r\nExpires: Thu, 01 Jan 1970 00:00:01
> GMT\r\nLast-Modified: Mon, 10 Oct 2005 21:22:28 GMT\r\n\r]
> ---------------8<--------------------------------
> Ok, this is main page that is reloaded every 20 sec.
>
> ---------------8<--------------------------------
> (3)
> 1128979353.680 1700 127.0.0.1 TCP_REFRESH_HIT/200 5269 GET
> http://kubok.yandex.ru/i/top6.gif evg DIRECT/213.180.204.2 image/gif [Host:
> kubok.yandex.ru\r\nUser-Agent: Mozilla/5.0 (OS/2; U; Warp 4.5; en-US;
> rv:1.4.1) Gecko/20031121\r\nAccept:
> video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1\r\nAccept-Language:
> ru,en-us;q=0.7,en;q=0.3\r\nAccept-Encoding: gzip,deflate\r\nAccept-Charset:
> KOI8-R,utf-8;q=0.7,*;q=0.7\r\nKeep-Alive: 300\r\nProxy-Connection:
> keep-alive\r\nReferer:
> http://kubok.yandex.ru/regkubok_msk1/a18820af44d1c98777244f3e2da43ebb/?&1029.27724170637\r\nCookie:
> mail_tag=yandex.ru; yandexuid=880632171062857853;
> yandex_login=\r\nProxy-Authorization: Basic ZXZnOjEyMw==\r\nPragma:
> no-cache\r\n] [HTTP/1.1 200 OK\r\nDate: Sun, 09 Oct 2005 09:16:56
> GMT\r\nServer: Apache/1.3.33 (Unix) mod_perl/1.29 PHP/4.4.0
> rus/PL30.20\r\nLast-Modified: Tue, 04 Oct 2005 16:59:41 GMT\r\nETag:
> "14da60-134e-4342b4fd"\r\nAccept-Ranges: bytes\r\nContent-Length:
> 4942\r\nConnection: close\r\nContent-Type: image/gif\r\n\r]
> ---------------8<--------------------------------
> Pragma: no-cache
> Last-Modified: Tue, 04 Oct 2005 16:59:41 GMT
>
> Why I should not place this image to cache ?!

It is cached, but the client forbids use of the cached entry (via "Pragma:
no-cache") forcing the cache to verify freshness.

> It truth somewere near the refresh_pattern ?

You can fiddle with refresh_pattern to override this specific case. But
beware that overriding "Pragma: no-cache" violates the HTTP
specifications.

Regards
Henrik
Received on Mon Oct 10 2005 - 16:51:09 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Nov 01 2005 - 12:00:07 MST