Saturday, February 14, 2015

Install and Configure Squid Cache 3.5 on Windows 7 & 8.1 (x86 & x64)

Install and Configure Squid Cache on Windows 7 & 8.1



First  of all download and install:
https://github.com/diladele/squid3-windows

Install it on a directory with no name spaces, I suggest C:\Squid
Do not start squid untill is fully configured to get the most of it. ok?

Config:
go to C:\Squid\etc\squid\squid.conf and add/edit the following lines to enable pipelining compatability, disk cache and enhanced memory cache.

#HTTP PIPELINING
pipeline_prefetch 8 # def 0, 1+value - 11 max parallel connections on mosts ISP's

maximum_single_addr_tries 4 #def 1
read_ahead_gap 32 KB
connect_retries 8
detect_broken_pconn on
client_request_buffer_max_size 1024 KB
client_persistent_connections on
server_persistent_connections on
dead_peer_timeout 11 seconds
minimum_icp_query_timeout 50
icp_query_timeout 3500
maximum_icp_query_timeout 4000
mcast_icp_query_timeout 3500
server_idle_pconn_timeout 30 seconds

request_header_max_size 96 KB

#CACHE TWEAKS
cache_swap_low 90
cache_swap_high 95


#MEMORY CACHE
cache_mem 128 MB #default values is 128
maximum_object_size_in_memory 1024 KB #default is 512KB


#DISK CACHE
#
cache_dir ufs path/to/cache/directory size_in_MB 16 256
cache_dir ufs C:/Squid/var/cache/squid 1024 16 256
maximum_object_size 4096 KB
minimum_expiry_time 90 seconds


# pictures & images
refresh_pattern -i \.(gif|png|jpeg|jpg|bmp|tif|tiff|ico)$ 10080 60% 26600 override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-auth ignore-private ignore-no-store


refresh_pattern -i \.(gif|png|jpeg|jpg|bmp|tif|tiff|ico)\? 10080 60% 26600 override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-auth ignore-private ignore-no-store

#flash & media
refresh_pattern -i \.(iso|avi|wav|mp3|mp4|mpeg|swf|flv|x-flv)$ 43200 95% 432000 override-expire ignore-no-cache ignore-no-store ignore-private store-stale


#to cache no-cache images and flash content and revalidate them when needed


This config can be used on Squid 3.5 linux to optimize performance.
Now if you need more info about configuring squid go to
http://www.squid-cache.org/Doc/config/

Create cache directory structure:
execute in CMD
C:\Squid\bin\squid.exe -z

This will create the mentioned directory structure at cache_dir
Now we can Start Squid Server tray

Squid will be operating using port 3128, accesible on 127.0.0.1 and your DHCP/Static IP
use Squid Server tray to start/stop squid
the service name is squidsrv.

If you use Firefox, you might enable pipelining.
write about:config on addres bar and press enter
change the following parameters.
network.http.pipelining true
network.http.pipelining.abtest true
network.http.pipelining.aggressive false
network.http.pipelining.reschedule-timeout 2200
network.http.pipelining.ssl true
network.http.proxy.pipelining true


TheFox


2 comments:

  1. Yo Fox, yeah you.

    We specialize in serving intelligent network administrators high quality blacklists for effective, targeted inline web filtering leveraging Squid proxy. We are the worlds leading and ONLY publisher of blacklists tailored specifically for use with Squid Proxy Native ACL. We also publish the worlds LARGEST adult domain blacklist, as well, as the worlds first blasphemy blacklist. Our works are available in several alternative formats for compatibility with multiple other web filter platforms. There is a demand for a better blacklist. And with few alternatives available, we intend to fill that gap.

    Squidblacklist.org Est. 2012. Owned and maintained by Benjamin E. Nichols & Co. It is an extension of the work I have been doing for years applying filters to my own networks with squid proxy and firewalls. Squidblacklist.org is platform whereby I hope to share the amalgamation of these works with the community, in the hopes that it will serve the greater good, helping to secure networks while providing a useful resource for individuals looking for a reasonable level of control of http traffic on their respective networks using a range of filtering solutions.


    It would be our pleasure to serve you,

    Signed,

    Benjamin E. Nichols
    http://www.squidblacklist.org

    ReplyDelete
  2. to work in windows you must tu use awin32
    cache_dir awin32 c:/squid/var/cache/squid 10000 16 256

    ReplyDelete