# squid cache not working

## mister

i have squid in my gentoo server the proxy is working perfectly but the cache still not working i have trying every thing i know but without any result

in my access.log i still the same message for all the websites i vist, here is a sample of the access.log file

1168693417.349     73 192.168.4.2 TCP_MISS/200 2131 POST http://192.168.4.1/cache/accessrefresh.php - DIRECT/192.168.4.1 text/html

1168693417.643    294 192.168.4.2 TCP_REFRESH_HIT/304 205 GET http://192.168.4.1/cache/rouge.css - DIRECT/192.168.4.1 -

1168693418.194    551 192.168.4.2 TCP_REFRESH_HIT/304 204 GET http://192.168.4.1/cache/fond.gif - DIRECT/192.168.4.1 -

1168693418.268      2 192.168.4.2 TCP_REFRESH_HIT/304 206 GET http://192.168.4.1/cache/EXTENDED_LOGO.gif - DIRECT/192.168.4.1 -

1168693418.446    160 192.168.4.2 TCP_MISS/200 118382 GET http://192.168.4.1/cache/access.php - DIRECT/192.168.4.1 text/html

1168693418.638      0 192.168.4.2 TCP_IMS_HIT/304 238 GET http://192.168.4.1/cache/rouge.css - NONE/- text/css

1168693419.037    399 192.168.4.2 TCP_IMS_HIT/304 231 GET http://192.168.4.1/cache/fond.gif - NONE/- image/gif

1168693419.047      9 192.168.4.2 TCP_IMS_HIT/304 239 GET http://192.168.4.1/cache/EXTENDED_LOGO.gif - NONE/- image/gif

1168693431.895     58 192.168.4.2 TCP_MISS/200 42425 POST http://192.168.4.1/cache/accessdate.php - DIRECT/192.168.4.1 text/html

1168693431.947     10 192.168.4.2 TCP_IMS_HIT/304 239 GET http://192.168.4.1/cache/rouge.css - NONE/- text/css

1168693432.037     90 192.168.4.2 TCP_IMS_HIT/304 240 GET http://192.168.4.1/cache/fond.gif - NONE/- image/gif

1168693432.040      2 192.168.4.2 TCP_IMS_HIT/304 240 GET http://192.168.4.1/cache/EXTENDED_LOGO.gif - NONE/- image/gif

1168693442.278    743 192.168.4.2 TCP_MISS/200 118382 GET http://192.168.4.1/cache/access.php - DIRECT/192.168.4.1 text/html

1168693640.784    480 192.168.4.2 TCP_MISS/302 480 GET http://www.google.com/ - DIRECT/209.85.129.104 text/html

1168693641.271    482 192.168.4.2 TCP_MISS/200 1932 GET http://www.google.ae/ - DIRECT/209.85.129.147 text/html

1168693646.635    370 192.168.4.2 TCP_MISS/200 4973 GET http://www.google.ae/search? - DIRECT/209.85.129.147 text/html

1168693653.189    829 192.168.4.2 TCP_MISS/200 5511 GET http://www.squid-cache.org/mail-archive/squid-users/199801/0485.html - DIRECT/12.160.37.9 text/html

1168693654.204    660 192.168.4.2 TCP_MISS/200 1232 GET http://www.squid-cache.org/favicon.ico - DIRECT/12.160.37.9 image/x-icon

1168693695.990    473 192.168.4.2 TCP_MISS/302 480 GET http://www.google.com/ - DIRECT/209.85.129.147 text/html

1168693696.456    464 192.168.4.2 TCP_MISS/200 1934 GET http://www.google.ae/ - DIRECT/209.85.129.99 text/html

1168693706.517    842 192.168.4.2 TCP_MISS/200 5008 GET http://www.google.ae/search? - DIRECT/209.85.129.99 text/html

1168693709.787   1562 192.168.4.2 TCP_MISS/200 1487 GET http://www.squid-cache.org/mail-archive/squid-users/200205/0744.html - DIRECT/12.160.37.9 text/html

1168693710.342   1047 192.168.4.2 TCP_MISS/200 7881 GET http://www.squid-cache.org/mail-archive/squid-users/200205/0744.html - DIRECT/12.160.37.9 text/html

1168693851.995    464 192.168.4.2 TCP_MISS/302 480 GET http://www.google.com/ - DIRECT/209.85.129.99 text/html

1168693852.485    482 192.168.4.2 TCP_MISS/200 1932 GET http://www.google.ae/ - DIRECT/209.85.129.104 text/html

1168693874.004    475 192.168.4.2 TCP_MISS/302 480 GET http://www.google.com/ - DIRECT/209.85.129.104 text/html

1168693874.250    246 192.168.4.2 TCP_MISS/200 1930 GET http://www.google.ae/ - DIRECT/209.85.129.104 text/html

so anyone have an idea  :Idea: 

----------

## m_spidey

Hi There

I'm just looking at your logs, 

 *Quote:*   

> 1168693417.643 294 192.168.4.2 TCP_REFRESH_HIT/304 205 GET http://192.168.4.1/cache/rouge.css - DIRECT/192.168.4.1 -

 

Isn't that a hit from ur cache?

I did notice that you tried www.google.com a few times, but I also did notice that google returned different ip's each time you queried it, so it probably wouldn't have retrieved it from cache.

Maybe you can post you squid.conf and describe in more detail where your problem lies?

Cheers

----------

## mister

http_port 192.168.4.1:8080

hierarchy_stoplist cgi-bin ?

acl QUERY urlpath_regex cgi-bin \?

no_cache deny QUERY

cache_mem 64 MB

maximum_object_size_in_memory 64 KB

maximum_object_size 512 MB

minimum_object_size 0 KB

cache_swap_low 90

cache_swap_high 95

cache_dir ufs /var/cache/squid 100 16 256

cache_access_log /var/log/squid/access.log

cache_log /var/log/squid/cache.log

cache_store_log /var/log/squid/store.log

hosts_file /etc/hosts

auth_param basic children 5

auth_param basic realm Squid proxy-caching web server

auth_param basic credentialsttl 2 hours

auth_param basic casesensitive off

refresh_pattern ^ftp:           15    20%     2280

refresh_pattern ^gopher:        15    0%      2280

refresh_pattern .               15       20%     2280

acl all src 0.0.0.0/0.0.0.0

acl manager proto cache_object

acl localhost src 127.0.0.1/255.255.255.255

acl to_localhost dst 127.0.0.0/8

acl our_networks src 192.168.4.0/24

acl SSL_ports port 443 563

acl Safe_ports port 80          # http

acl Safe_ports port 21          # ftp

acl Safe_ports port 443 563     # https, snews

acl Safe_ports port 70          # gopher

acl Safe_ports port 210         # wais

acl Safe_ports port 1025-65535  # unregistered ports

acl Safe_ports port 280         # http-mgmt

acl Safe_ports port 488         # gss-http

acl Safe_ports port 591         # filemaker

acl Safe_ports port 777         # multiling http

acl Safe_ports port 901         # SWAT

acl purge method PURGE

acl CONNECT method CONNECT

acl BADsites dstdomain "/test/BADsites"

acl BADwords dstdom_regex -i "/test/BADwords"

acl BADextensions url_regex -i "test/BADextensions"

http_access allow manager localhost

http_access deny manager

http_access allow purge localhost

http_access deny purge

http_access deny !Safe_ports

http_access deny CONNECT !SSL_ports

http_access deny BADsites

http_access deny BADwords

http_access deny BADextensions

http_access allow our_networks

http_access allow localhost

http_access deny all

http_reply_access allow all

icp_access allow all

visible_hostname localhost

httpd_accel_host virtual

httpd_accel_port 80

httpd_accel_with_proxy on

httpd_accel_uses_host_header on

memory_pools on

forwarded_for off

coredump_dir /var/cache/squid

----------

## JC99

I just checked my log and am having the same problems, no idea why?

----------

