Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Squid client purge utility [closed]

Tags:

squid

I've been using the purge utility ie.

squidclient -m PURGE http://www.example.com/

The above command will purge that exact link but it leaves everything else under it in the cache. (eghttp://www.example.com/page1)

I was wondering is there a way to purge every document under that url?

like image 557
Ruth Avatar asked Feb 28 '23 16:02

Ruth


2 Answers

I've had limited success messing with this line:

awk '{print $7}' /var/log/squid/access.log | grep www.example.com | sort | uniq | xargs -n 1 squidclient -m PURGE -s
like image 127
gareth Avatar answered May 16 '23 06:05

gareth


First of all thank you KimVais for advising me to ask in serverfault, I have found a solution there.

as answered in serverfault:

The 3rd-party purge utility will do exactly what you seek:

The purge tool is a kind of magnifying glass into your squid-2 cache. You can use purge to have a look at what URLs are stored in which file within your cache. The purge tool can also be used to release objects which URLs match user specified regular expressions. A more troublesome feature is the ability to remove files squid does not seem to know about any longer.

For our accelerating (reverse) proxy, I use a config like this:

purge -c /etc/squid/squid.conf -p localhost:80 -P0 -se 'http://www.mysite.com/' -P0 will show the list of URLs but not remove them; change it to -P1 to send PURGE to the cache, as you do in your example.

like image 25
Ruth Avatar answered May 16 '23 08:05

Ruth