Squid proxy server limit download size


How to limit the squid proxy server download size

Squid download limit

Add the following line in the squid.conf file
Use based download limit is tested only on squid-3.0.STABLE20-2 and older versions.

 acl Group1 proxy_auth user1 user2
 acl Group2 proxy_auth user3 user4

 reply_body_max_size 20480 KB Group2
 reply_body_max_size 10240 KB Group1
 reply_body_max_size 5120 KB all

For version squid-3.1 and higher , you can use IP based download limit

 acl Group1 src 10.5.0.1-10.5.0.10/32
 acl Group2 src 10.5.2.1-10.5.2.10/32

 reply_body_max_size 20480 KB Group2
 reply_body_max_size 10240 KB Group1
 reply_body_max_size 5120 KB all

Time Based Download Limit

 acl WorkingHours time 08:00-17:00
 reply_body_max_size 10240 KB WorkingHours
Save the settings and restart the service
#service squid restart