Squid Proxy - How to Turn Off and/or Empty the Cache

Update: Or, just install this handy RPM -- squid properties. Allows you to specify domains which should always be direct connect, flush the cache, etc.

All these rules need to be added to /etc/squid/squid.conf, then you need to issue the following two commands:

squid -k shutdown
squid -s -D

This shuts squid down, then brings it back up again, which makes it reload the config file.

Turning off caching for a specific site

(from the e-smith discussion forum):

acl RULENAME dstdomain .www.domain.com
no_cache deny RULENAME

Emptying the cache for specific entries

(from the e-smith discussion forum):

acl PURGE method PURGE
acl localhost src 127.0.0.1
http_access allow PURGE localhost
http_access deny PURGE

After doing the shutdown/startup sequence, you can now issue the following command to clear the cache:

client -m PURGE http://www.domain.com/particular/page.html

A successful purge returns an 200 OK response -- something else usually means the item wasn't in the cache to begin with.

Comments

the squid proxy - denying users access to internet

I tried this option in the squid properties and it seems that the only thing the users are being denied is browsing the web in their browser. while services like msn messenger and ftp still works. is there a way to prevent this? -yeah, I'm pretty fresh to this whole linux thing..