Operating System - Linux
1825001 Members
2524 Online
109678 Solutions
New Discussion юеВ

Re: which is the best way to delete squid cache ?

 
SOLVED
Go to solution
'chris'
Super Advisor

which is the best way to delete squid cache ?

hi

which is the best way to delete squid cache ?
how often should I do that ?
I have Squid 2.5.STABLE4 installed on linux SUSE 8.2
and I'm using it for about 250 clients.
for Squid Cache I have configured 20GB in squid.conf :

cache_dir ufs /var/cache/squid 20000 16 256

kind regards
chris
11 REPLIES 11
Stuart Browne
Honored Contributor
Solution

Re: which is the best way to delete squid cache ?

To remove the Squid cache (which I don't advise), you stop squid, 'rm -fr /var/cache/squid/*', then start squid again (which will re-make the structure).

I *DO NOT* advise doing this. The whole point of Squid is to have those cached files. The ageing settings is what you care about, as this tells squid whether it should keep something in the cache or not (see the 'refresh_pattern' settings in squid.conf).
One long-haired git at your service...
Steven E. Protter
Exalted Contributor

Re: which is the best way to delete squid cache ?

I'm wondering why you are wanting to delete the squid cache in the first place. If the target website has updated its content, the cache should be updated.

If you could provide reasoning for wanting to delete it, there might be possible suggestions on improving the situation.

Stuart's already provided you the info on how to do it.

I would shut down the squid server prior to going against his advice. At least the server will start clean.

Once a day should do it, if you go ahead. You will notice users slowing down after the cache is dumped.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
'chris'
Super Advisor

Re: which is the best way to delete squid cache ?

hi

I would like to delete, because our proxy users have a problem
with one website (booking engine).
Some users can work with these webseite without problems
and some of them get page errors.
Shift-Refresh doesn't help.
Or how can I delete not the whole cache,
but only the cache of these webseite ?

greetings
chris
Stuart Browne
Honored Contributor

Re: which is the best way to delete squid cache ?

What do the Squid logs say about that website for the affected workstations?
One long-haired git at your service...
'chris'
Super Advisor

Re: which is the best way to delete squid cache ?

I don't know because I deleted the whole cache and now it seems to work without problems.
'chris'
Super Advisor

Re: which is the best way to delete squid cache ?

is it any way to delete the cache from only one webseite instead of the whole cache from the all webseites ?
xyko_1
Esteemed Contributor

Re: which is the best way to delete squid cache ?

Hi Chris,

If your problem occurs only for known sites you may tell squid not to cache those sites.

See the documentation on http://www.squid-cache.org/Doc/FAQ/FAQ-7.html#ss7.8

regards,
xyko
'chris'
Super Advisor

Re: which is the best way to delete squid cache ?

thanks,

but should I really put this:
^
before the URL ?

acl XYZZY url_regex ^http://www.i.suck.com/foo.html$
no_cache deny XYZZY
Stuart Browne
Honored Contributor

Re: which is the best way to delete squid cache ?

In a regular expression, the symbol ^ means that the atom is at the very start of a string. The $ symbol means that the atom is at the very end of the string.

i.e. ^http:// means the URL has to start with 'http://'.

The example you've got in your previous post would seem that the enture URL would have to be an exact match.
One long-haired git at your service...
Axel M├╝ller_2
Regular Advisor

Re: which is the best way to delete squid cache ?

Is there an way to delete only one specific object from the squid cache?
Stuart Browne
Honored Contributor

Re: which is the best way to delete squid cache ?

Hrm.. Try http://www.squid-cache.org/mail-archive/squid-users/199707/0342.html , but I've never tried it.
One long-haired git at your service...