November 23, 2024, 03:19:23 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: How to Clear squid cache  (Read 34922 times)

Offline dragoncity99

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 551
How to Clear squid cache
« on: May 29, 2004, 04:52:05 PM »
Hi guys,

   Anyone of u know how to clear squid's cache. I'm using Fedora Core  1


 Thank you! in advance.

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
How to Clear squid cache
« Reply #1 on: May 30, 2004, 05:32:33 AM »
Well ther is no specific way to clear squid cache..
What i do is change the name of the squid cache directory and then give new directory in squid.conf and delete the old one.. then initialize new one from -z directive

Offline dragoncity99

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 551
How to Clear squid cache
« Reply #2 on: May 30, 2004, 03:14:33 PM »
OIC, what it i dont use the -z directive ricky?

It works for me. I wonder why???? Weird....

For me to clear cache, i'm currently using this method:

1. Stop squid
2. Set a null byte to "swap.state" file using command

    echo "" > swap.state

3. Then start the squid back.

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
How to Clear squid cache
« Reply #3 on: May 31, 2004, 05:29:51 AM »
I kno that one but I prefer my method.. ;) I had  seen your method mentioned in various squid docs..  but few it caused me prob..
two time I had prob of "squid space over limit" then this one don't works..

Offline dragoncity99

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 551
How to Clear squid cache
« Reply #4 on: May 31, 2004, 07:40:11 AM »
Oh ok ok. IC now. 10q :)

Oh yes, ur method right when i forget to use the -z option how come it's still able to run? Will this mean that the cache will be still be done on previous cache directory if i don't delete the previous directory?

Have u ever tried to control bandwidth per user basis on squid? Just like cbq did to control the bandwidth of internet bandwidth in a LAN?

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
How to Clear squid cache
« Reply #5 on: May 31, 2004, 11:06:31 AM »
Yes you can do it on per user basis.. You have to then create delay pool for every user.
I answered this many time.. lets once again..
here it is for a user who has ip of 192.168.11.11
Code: [Select]
acl ip_1 src 192.168.11.11/255.255.255.0
delay_pools 1
delay_class 1 1
delay_parameters 1 2200/4000
delay_access 1 allow ip_1
Now above will work when the user have downloaded 2200 bytes after that its connection will be 32 kilo bits per seconde . ( 2200/4000 means after 2200 bytes recieved limit speed to 4000 ie .. 32 kpbs )
hw ever i m always confused by the stuff hw 4000 = 32 kbps ;) so u find out itself.. how 4000 = 32 kpbs.. ;)

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
How to Clear squid cache
« Reply #6 on: May 31, 2004, 11:11:34 AM »
oh. abt cache initialization..
well when we use -z , it simply create directory and subdirectory according to algo.. and that is a script built in squid . so if u put null charractoin in swap.stat then u have just deleted all the cache record and to squid it is empty, but as the squid cache directories are already there then no need of -z . all current cache data get lost when squid check the cache.. and when it sees that swap.stat has nothing then it empty all directories os deleting current cache ..
Hope i am clear

Offline jwaterbury

  • Linux Noob !
  • *
  • Posts: 10
Not Caching
« Reply #7 on: December 16, 2004, 04:42:58 PM »
:?

I have been having a problem for some time now and have not found a resolution for it anywhere. My squid is working great with content filtering but it will not cache any of the web sites visited. I have checked over and over the config file and all looks good from what I see. I have also designated a user and group in the config file and ensured that the same info was in the directory permissions for the cache folder and the log folder. I have stopped and restarted the cache and no change. I check the swap.state file and even after days have passed it is still empty as well are the folders in the cache folder. Where am I going wrong? Please Help!!!!

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
How to Clear squid cache
« Reply #8 on: December 17, 2004, 10:23:50 AM »
Kindly give me last 10 lines of your cache.log :)

btw. have u initialized the cache using -z directive ?

Offline jwaterbury

  • Linux Noob !
  • *
  • Posts: 10
How to Clear squid cache
« Reply #9 on: December 17, 2004, 04:59:30 PM »
I have initilized the directory with the squid -z function. It builds all the directories and everything looks like is is normal. When I start squid the program acts like it is running like it should but I never see any files appear the the directories. The swap.state file also stays empty. Nothing is ever saved in the cache directory. I also do not see any speed increase after using squid as the users are getting the web site as fast as the T1 can give it. If the site was cached you should see a speed increase when you go back to the same site. I will post the last few lines soon.

Thanks

Offline jwaterbury

  • Linux Noob !
  • *
  • Posts: 10
How to Clear squid cache
« Reply #10 on: December 17, 2004, 05:05:08 PM »
Here are the lines
2004/12/17 03:05:55| Reconfiguring Squid Cache (version 2.5.STABLE6)...
2004/12/17 03:05:55| FD 8 Closing HTTP connection
2004/12/17 03:05:55| FD 10 Closing ICP connection
2004/12/17 03:05:55| Cache dir '/usr/local/squid/var/cache' size remains unchanged at 8192000 KB
2004/12/17 03:05:55| DNS Socket created at 0.0.0.0, port 32785, FD 7
2004/12/17 03:05:55| Adding nameserver 64.69.96.35 from /etc/resolv.conf
2004/12/17 03:05:55| Adding nameserver 205.205.1.5 from /etc/resolv.conf
2004/12/17 03:05:55| Accepting HTTP connections at 0.0.0.0, port 3128, FD 8.
2004/12/17 03:05:55| Accepting ICP messages at 0.0.0.0, port 3130, FD 10.
2004/12/17 03:05:55| WCCP Disabled.
2004/12/17 03:05:55| Loaded Icons.
2004/12/17 03:05:55| Ready to serve requests.

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
How to Clear squid cache
« Reply #11 on: December 18, 2004, 08:42:55 AM »
I need little more lines.. and btw the lines you have given are when you use -k reconfigure directive, give me actual one you start your squid,

BTW you have asked same question in another thread .. here ---> http://www.linuxsolved.com/forums/ftopic968.html so we will now discuss this there only!

Offline dragoncity99

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 551
How to Clear squid cache
« Reply #12 on: December 22, 2004, 11:31:06 AM »
Did he did something to disable the caching Ricky? like /dev/null to the squid.conf file?

Offline hitesh

  • Linux Noob !
  • *
  • Posts: 11
How to Clear squid cache
« Reply #13 on: December 24, 2004, 05:09:14 AM »
dragoncity99,

i think you can clear the squid cache with webmin. i mean if you have install webmin ,you can access and clear the cookies by typeing the URL into the browser with
 yourdomain.com:10000/

there is one option to clear the cache, but it wil take some time clear it.I hope this helps you.  

about deal pool. Ricky is right ..

Hey, Ricky i also have doubt about deal pool, means how i can define/create deal pool future per user, can u provide me some good document on this, i want to setup squid with deal pool future,

what you suggest about caching server. let say i want to setup squid with proxy and cache server with deal pool. should i setup on fresh machin OR i can setup on the same PC with other services.

finaly, i need to clear deal pool concept, i m little bitt lack in this. Please help me...

-/Hitesh

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
How to Clear squid cache
« Reply #14 on: December 24, 2004, 09:09:13 AM »
Hitesh..
it is called Delay pools, the best place to look about delay pools is the squid documentation found at squid-cache.org

btw look my few last post about delay pools. you will find a hint.