Ubuntu

Squid3 從不記憶體圖像文件

  • November 21, 2014

我剛剛在 Ubuntu 14.04 上安裝了 3.3.8。但是我發現 squid3 從不記憶體任何靜態圖像文件。

這是我的 squid3.conf

auth_param digest program /usr/lib/squid3/digest_file_auth -c /etc/squid3/passwords
auth_param digest realm proxy
acl authenticated proxy_auth REQUIRED
acl local src 127.0.0.1/32
acl ukpro src "/etc/squid3/ukip.txt"
http_access allow ukpro
http_access allow local
http_access allow authenticated
http_port 3128

cache_dir ufs /var/spool/squid3 3072 16 256
minimum_object_size 1 KB
maximum_object_size 1 MB
cache_swap_low 87
cache_swap_high 90
memory_pools off

netdb_filename none
pinger_enable off

#refresh_pattern -i .jpg$ 0 60% 1440 ignore-no-cache ignore-no-store reload-into-ims
#strip_query_terms off
refresh_pattern -i  \.(gif|png|jpg|jpeg|ico)$ 1440 100% 525949 override-expire ignore-reload ignore-no-cache ignore-no-store ignore-must-revalidate ignore-private ignore-auth

這是始終顯示 TCP_MISS/200 的日誌(相同的圖像 url):

1414349354.186    644 127.0.0.1 TCP_MISS/200 97198 GET http://heartmindandseoul.com/wp-content/uploads/2013/03/squid3.jpg - HIER_DIRECT/173.254.28.23 image/jpeg
1414349358.061    500 127.0.0.1 TCP_MISS/200 97198 GET http://heartmindandseoul.com/wp-content/uploads/2013/03/squid3.jpg - HIER_DIRECT/173.254.28.23 image/jpeg
1414349359.782    624 127.0.0.1 TCP_MISS/200 97198 GET http://heartmindandseoul.com/wp-content/uploads/2013/03/squid3.jpg - HIER_DIRECT/173.254.28.23 image/jpeg
1414349377.096    659 127.0.0.1 TCP_MISS/200 97198 GET http://heartmindandseoul.com/wp-content/uploads/2013/03/squid3.jpg - HIER_DIRECT/173.254.28.23 image/jpeg
1414349725.175    652 127.0.0.1 TCP_MISS/200 97198 GET http://heartmindandseoul.com/wp-content/uploads/2013/03/squid3.jpg - HIER_DIRECT/173.254.28.23 image/jpeg
1414349727.522    514 127.0.0.1 TCP_MISS/200 97198 GET http://heartmindandseoul.com/wp-content/uploads/2013/03/squid3.jpg - HIER_DIRECT/173.254.28.23 image/jpeg

誰能給我一些建議?謝謝你。

刪除minimum_object_size導致即時命中,首先在記憶體中,然後在重新啟動伺服器後在磁碟上,我無法真正解釋原因(這沒有意義,因為圖像比這大得多)但至少可以解決您的問題。

引用自:https://serverfault.com/questions/639784