How to clear the cache Squid and recreate

By | ottobre 10, 2016

How do I know where is the Squid cache in the Linux Filesystem, and recreate it as empty?

The Squid cache stores the pages that are made by the client in order to return more quickly on subsequent requests without having to re-download every time the same page from the internet. It may happen, however, of having to clear the cache is to update it, and because it is full. Let’s see what is the correct procedure to be performed!

We identify first where is the Squid cache with the command:

# cat /etc/squid/squid.conf | grep cache_dir

we will see an output similar:

cache_dir ufs /var/spool/squid 10000 32 256

in this case in the directory: /var/spool/squid

Stop the process of Squid with the command:

For CentOS/RHEL/Debian:

# /etc/init.d/squid stop

For ArchLinux

# systemctl stop squid

eliminate the cache with the command:

# rm -rf /var/spool/squid/*

recreate the cache with the command:

# squid -z

Restart Squid with the command:

For CentOS/RHEL/Debian:

# /etc/init.d/squid start

For ArchLinux

# systemctl start squid

At this point we can see the different Squid log cache_log and access_log to verify proper operation!

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *