Optimized Squid 3.1 Proxy Configuration Settings

On February 20, 2012, in Personal, by Lawrence Pingree

I’ve spent 3 months perfecting the cache capabilities of my squid cache proxy and come up with the following…although I occasionally still have some problems with http11 support this configuration has performed optimally for me. I have a 75 gig hard drive and a 2.66 celeron processor operating on opensuse 12.2

- Last Updated: 03-19-2012

#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines

acl Safe_ports port 1-65535
acl CONNECT method GET POST HEAD CONNECT PUT DELETE # http

#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow all

# Deny requests to certain unsafe ports

# Deny CONNECT to other than secure SSL ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on “localhost” is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed

# allow localhost always proxy functionality

# And finally deny all other access to this proxy

# Squid normally listens to port 3128
http_port 8080 transparent

# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?

# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /var/cache/squid 32768 36 256

# Leave coredumps in the first cache dir
coredump_dir /var/cache/squid

# Add any of your own refresh_pattern entries above these.
refresh_pattern -i \.(gif|png|jpg|jpeg|ico|bmp|tiff)$ 5440 90% 9760 override-expire
refresh_pattern -i \.(bin|deb|rpm|exe|zip|tar|tgz|ram|rar|bin|ppt|doc|docx|tiff|pdf|uxx|gz|xls|swf|psd|js|crl)$ 5440 90% 9760 override-expire
refresh_pattern \.(wav|mp3)$ 5440 90% 5760 reload-into-ims
refresh_pattern -i \.(html|htm|css)$ 1440 90% 5760
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern ^ftp: 5440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i . 0 40% 5760
ignore_expect_100 on
log_icp_queries off
check_hostnames off
#minimum_object_size 1 KB
cache_mem 768 MB
buffered_logs on
pipeline_prefetch on
cache_effective_user squid
cache_effective_group squid
dns_v4_fallback on
cache_replacement_policy heap GDSF
memory_replacement_policy heap GDSF
header_replace User-Agent Mozilla/5.0 (X11; U;) Gecko/20080221 Firefox/2.0.0.9
maximum_object_size 256 MB
visible_hostname shadow
unique_hostname shadow
client_db off
read_ahead_gap 256 KB
#memory_pools off
access_log none

.

 



Tags: , , , , , , , , ,
Tagged with: