« [IPCN] proxy.ipcn.org 200403 使用统计 |
Main
| [FWD] 802.1x:开创认证新时代 »
March 31, 2004
squid refresh demo
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明。
https://windtear.net/archives/2004/03/31/000425.html
s.q.u.i.d - - [31/Mar/2004:14:49:25 +0800] "GET /a.txt HTTP/1.0" 200 7 s.q.u.i.d - - [31/Mar/2004:14:49:39 +0800] "GET /a.txt HTTP/1.0" 200 9 s.q.u.i.d - - [31/Mar/2004:14:50:27 +0800] "GET /a.txt HTTP/1.0" 200 12 s.q.u.i.d - - [31/Mar/2004:14:51:18 +0800] "GET /a.txt HTTP/1.0" 304 - s.q.u.i.d - - [31/Mar/2004:14:51:50 +0800] "GET /a.txt HTTP/1.0" 200 14 s.q.u.i.d - - [31/Mar/2004:14:53:21 +0800] "GET /a.txt HTTP/1.0" 304 -
1080715727.780 3181 c.l.i.e.n.t TCP_MISS/200 362 GET http://s.e.r.v.e.r/a.txt - DIRECT/s.e.r.v.e.r text/plain 1080715742.167 1531 c.l.i.e.n.t TCP_REFRESH_MISS/200 364 GET http://s.e.r.v.e.r/a.txt - DIRECT/s.e.r.v.e.r text/plain 1080715789.522 3172 c.l.i.e.n.t TCP_REFRESH_MISS/200 368 GET http://s.e.r.v.e.r/a.txt - DIRECT/s.e.r.v.e.r text/plain 1080715841.225 3170 c.l.i.e.n.t TCP_REFRESH_HIT/304 251 GET http://s.e.r.v.e.r/a.txt - DIRECT/s.e.r.v.e.r - 1080715872.324 10040 c.l.i.e.n.t TCP_REFRESH_MISS/200 370 GET http://s.e.r.v.e.r/a.txt - DIRECT/s.e.r.v.e.r text/plain 1080715963.812 3277 c.l.i.e.n.t TCP_REFRESH_HIT/304 251 GET http://s.e.r.v.e.r/a.txt - DIRECT/s.e.r.v.e.r -
s.e.r.v.e.r% touch a.txt
s.q.u.i.d - - [31/Mar/2004:14:54:21 +0800] "GET /a.txt HTTP/1.0" 200 14
1080716023.459 3253 c.l.i.e.n.t TCP_REFRESH_MISS/200 370 GET http://s.e.r.v.e.r/a.txt - DIRECT/s.e.r.v.e.r text/plain
--- 可以明显看出缓存的处理情况 1.第一次 TCP_MISS 取 server 数据 (7bytes) 2.3.改动 server 源文件 TCP_REFRESH_MISS (9bytes 12bytes) 4.不改动 server 源文件 TCP_REFRESH_HIT (server 返回 304) 缓存命中 取 cache 5.再改动 server 源文件 (12->14bytes) TCP_REFRESH_MISS 6.不改动 再去 hit cache
7.不做内容改动 只touch server 源文件 TCP_REFRESH_MISS 14bytes
对于 a.txt 未作 pattern 符合 # refresh_pattern . 0 20% 4320
如果强制防止刷新用 refresh_pattern -i .html 1440 90% 129600 reload-into-ims usage: refresh_pattern [-i] regex min percent max [options] options: overrsde-expire override-lastmod reload-into-ims ignore-reload ...
# Please see the file doc/Release-Notes-1.1.txt for a full # description of Squid's refresh algorithm. Basically a # cached object is: (the order is changed from 1.1.X) # # FRESH if expires < now, else STALE # STALE if age > max # FRESH if lm-factor < percent, else STALE # FRESH if age < min # else STALE
|
|
Posted by windtear at March 31, 2004 5:33 PM