为什么 Squid 的日志中很少出现 TCP_HIT,而大部分都是 TCP_MISS?

为什么 Squid 的日志中很少出现 TCP_HIT,而大部分都是 TCP_MISS?

我正在使用 Squid v2.7。

我在日志中收到很多 TCP_MISS 消息,但收到很少的 TCP_HIT 消息。

这是什么意思?

ps 以下是日志示例:

1369840631.853     59 127.0.0.1 TCP_MISS/200 49714 GET http://pagead2.googlesyndication.com/pagead/imgad? - DIRECT/173.194.41.77 application/x-shockwave-flash
1369840631.883    141 127.0.0.1 TCP_MISS/302 1254 GET http://altfarm.mediaplex.com/ad/js/18329-129461-2056-10? - DIRECT/89.207.18.182 -
1369840631.964    163 127.0.0.1 TCP_MISS/200 7939 CONNECT urs.microsoft.com:443 - DIRECT/157.55.231.253 -
1369840631.971    160 127.0.0.1 TCP_MISS/200 7971 CONNECT urs.microsoft.com:443 - DIRECT/157.55.231.253 -
1369840632.093    205 127.0.0.1 TCP_MISS/200 8803 GET http://img.mediaplex.com/content/0/18329/1510_FREE_CrystalClear_Fruitmachine_DCF_300x250_1cc304.js? - DIRECT/89.207.18.181 text/javascript
1369840632.317    193 127.0.0.1 TCP_MISS/200 56608 GET http://img-cdn.mediaplex.com/0/18329/1510_FREE_CrystalClear_Fruitmachine_DCF_300x250_1cc304.swf - DIRECT/46.33.70.42 application/x-shockwave-flash
1369840813.425 287250 127.0.0.1 TCP_MISS/200 12260 CONNECT plus.google.com:443 - DIRECT/173.194.34.70 -
1369840824.390 293221 127.0.0.1 TCP_MISS/200 5204 CONNECT csi.gstatic.com:443 - DIRECT/74.125.226.111 -
1369837426.298      0 127.0.0.1 TCP_MEM_HIT/200 2565 GET http://0.gravatar.com/avatar/0d5183de3952f6c8645c5e6140938ef7? - NONE/- image/png
1369837426.299      1 127.0.0.1 TCP_MEM_HIT/200 1917 GET http://0.gravatar.com/avatar/cbbed29064ada5c3686c4d980e545e67? - NONE/- image/jpeg
1369837426.299      0 127.0.0.1 TCP_MEM_HIT/200 2190 GET http://1.gravatar.com/avatar/9986282128def4361d1971b8bbe3d0d2? - NONE/- image/png

答案1

所有显示未命中缓存的请求可分为两类:

  1. HTTPS 请求,Squid 只是将其传递给远程站点。
  2. 广告请求,其中 URL 似乎是针对每个用户定制的。

相关内容