Quick script to purge URL from squid proxy

If you have the requisite permissions in squid.conf, you can just use a quick script to purge URLs. I use this for flushing local files I am developing and download to clients with http.

touch "${tf}" ; chmod 0755 "${tf}"
echo <<EOF > "${tf}"
for word in ${@} ;
   squidclient -h localhost -r -p 3128 -m PURGE "${word}"

For squid, I am using a few lines to allow purging:

acl PURGE method PURGE
http_access allow PURGE localhost

Then you can call it:

purge http://example.com/url1 http://example.com/url2 http://example.com/url3