Squid cache.

Taking care of your Linux box.
Post Reply
thecooldude
Lance Naik
Posts: 43
Joined: Sun Nov 26, 2006 6:04 pm
Location: Dubai, UAE.
Contact:

Squid cache.

Post by thecooldude »

Hello,

Please help me out to fix a problem regarding cache store and HIT!. Well, I want to store every even exe file downloaded anywhere in my network will store in my cache, and next if anyone download that file again squid will serve users through cache.. I want to save my bandwidth and store exe, mp3, flv, gif, jpg etc... if anything is already cached then squid will serve files from cache I also want to store cache for 60 days. I've tried alot but failed to do that so.. I'm Squid-2.5 currently! Here is my squid configuration... Please fix and help me out.

http_port 3128
cache_mem 512 MB

maximum_object_size 50 MB
maximum_object_size_in_memory 5120 KB

ipcache_size 8192
fqdncache_size 8192

cache_replacement_policy heap LFUDA
memory_replacement_policy heap LFUDA

cache_dir ufs /var/spool/squid 30000 16 256

ftp_passive on

refresh_pattern windowsupdate.com/.*\.(cab|exe) 4320 100% 43200 reload-into-ims
refresh_pattern download.microsoft.com/.*\.(cab|exe) 4320 100% 43200 reload-into-ims
refresh_pattern ^http://.*\.cnn\.com 360 50% 4320 override-lastmod
refresh_pattern ^http://news\.bbc\.co\.uk 360 50% 4320 override-lastmod
refresh_pattern microsoft 1080 150% 10080 override-lastmod
refresh_pattern msn\.com 4320 150% 10080 override-lastmod
refresh_pattern ^http://.*\.doubleclick\.net 10080 300% 40320 override-lastmod
refresh_pattern ^http://.*FIDO 360 1000% 480
refresh_pattern \.r[0-9][0-0]$ 10080 150% 40320
refresh_pattern ^http://.*\.gif$ 1440 50% 20160
refresh_pattern ^http://.*\.asis$ 1440 50% 20160
refresh_pattern -i \.pdf$ 10080 90% 43200
refresh_pattern -i \.art$ 10080 150% 43200
refresh_pattern -i \.avi$ 10080 150% 40320
refresh_pattern -i \.mov$ 10080 150% 40320
refresh_pattern -i \.wav$ 10080 150% 40320
refresh_pattern -i \.mp3$ 10080 150% 40320
refresh_pattern -i \.qtm$ 10080 150% 40320
refresh_pattern -i \.mid$ 10080 150% 40320
refresh_pattern -i \.viv$ 10080 150% 40320
refresh_pattern -i \.mpg$ 10080 150% 40320
refresh_pattern -i \.jpg$ 10080 150% 40320 reload-into-ims
refresh_pattern -i \.rar$ 10080 150% 40320
refresh_pattern -i \.ram$ 10080 150% 40320
refresh_pattern -i \.gif$ 10080 300% 40320 reload-into-ims
refresh_pattern -i \.txt$ 1440 100% 20160 reload-into-ims override-lastmod
refresh_pattern -i \.zip$ 2880 200% 40320
refresh_pattern -i \.arj$ 2880 200% 40320
refresh_pattern -i \.exe$ 2880 200% 40320
refresh_pattern -i \.tgz$ 10080 200% 40320
refresh_pattern -i \.gz$ 10080 200% 40320
refresh_pattern -i \.tgz$ 10080 200% 40320
refresh_pattern -i \.tar$ 10080 200% 40320
refresh_pattern -i \.Z$ 10080 200% 40320

refresh_pattern ^ftp:// 1440 50% 10080
refresh_pattern ^gopher:// 1440 10% 1440
refresh_pattern . 0 20% 4320
negative_ttl 1 minutes
positive_dns_ttl 15 hours
negative_dns_ttl 1 minutes
half_closed_clients off

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 Local src 192.168.0.1-192.168.0.100
acl Intra src 192.168.0.101-192.168.0.130
acl SSL_ports port 443 563
acl Safe_ports port 80
acl Safe_ports port 21
acl Safe_ports port 443 563
acl Safe_ports port 70
acl Safe_ports port 210
acl Safe_ports port 1025-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe_ports port 777
acl Safe_ports port 5150

acl CONNECT method CONNECT

http_access allow manager localhost
http_access allow Local
http_access allow Intra
http_access deny manager
http_access allow localhost
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports

#http_access deny block
http_access deny all

cache_mgr root
visible_hostname test

httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

cache_effective_user squid
cache_effective_group squid

delay_pools 2
delay_class 1 3
delay_parameters 1 900000/900000 900000/900000 90000/90000
delay_access 1 allow Local

delay_class 2 3
delay_parameters 2 640000/640000 640000/640000 64000/64000
delay_access 2 allow Intra


Thanks


Regards,
Post Reply