[K12OSN] OT - how to clear squid ip cache?

Eric Harrison eharrison at mail.mesd.k12.or.us
Wed Aug 25 02:58:59 UTC 2004


On Tue, 24 Aug 2004, Julius Szelagiewicz wrote:

>Dear Folks,
>	the subject asks the question. I have a problem with accessing a
>production site, where DNS resolves correctly, but browsers access the old
>test site because squid has the old ip in the cache. Googling on it tells
>me to run the cachemgr.cgi script, but how do I run it if apache is not
>running on the squid box? thanks, julius

The squidclient utility can clear a cached page.

Add the following lines to your /etc/squid/squid.conf

	acl PURGE method PURGE
	http_access allow PURGE localhost
	http_access deny PURGE


tell squid to re-read its configs:

	service squid reload

Now you can purge urls from the cache:

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

Note that this does individual pages, it does not purge a whole
website. If page1.html, page2.html, etc are all stale, you'll
have to purge each one:

	squidclient -m PURGE http://www.somewhere.com/page1.html
	squidclient -m PURGE http://www.somewhere.com/page2.html

-Eric





More information about the K12OSN mailing list