How To Clear Squid Proxy Cache And Re-create the Cache Directories

1) Find Squid cache dir location

Open a terminal and then type:
~# grep cache_dir /etc/squid/squid.conf

Sample outputs:

cache_dir ufs /var/spool/squid 100 16 256

2) Restart Squid with an empty cache

Open a terminal and login as root user. Or use the ssh command to login to the remote server. Once logged in type the following command to shutdown squid proxy server:
~# squid -k shutdown
~# rm -rf /path/to/dir/cache/
~# rm -rf /var/spool/squid/

Please note that you need repeat the rm command for each cache_dir location you wish to empty. To re-create the cache directories, enter:
~# squid -z

Sample outputs:

2013/08/24 04:24:19| Making directories in /var/spool/squid/00
2013/08/24 04:24:19| Making directories in /var/spool/squid/01
2013/08/24 04:24:19| Making directories in /var/spool/squid/02
2013/08/24 04:24:20| Making directories in /var/spool/squid/03
2013/08/24 04:24:20| Making directories in /var/spool/squid/04
2013/08/24 04:24:20| Making directories in /var/spool/squid/05
2013/08/24 04:24:20| Making directories in /var/spool/squid/06
2013/08/24 04:24:20| Making directories in /var/spool/squid/07
2013/08/24 04:24:20| Making directories in /var/spool/squid/08
2013/08/24 04:24:20| Making directories in /var/spool/squid/09
2013/08/24 04:24:20| Making directories in /var/spool/squid/0A
2013/08/24 04:24:20| Making directories in /var/spool/squid/0B
2013/08/24 04:24:20| Making directories in /var/spool/squid/0C
2013/08/24 04:24:20| Making directories in /var/spool/squid/0D
2013/08/24 04:24:20| Making directories in /var/spool/squid/0E
2013/08/24 04:24:20| Making directories in /var/spool/squid/0F

To start squid type:
~# squid

OR
~# service squid start

Sample outputs:

Starting squid:                                            [  OK  ]

3) Verify Squid is running

Type the following commands:
~# netstat -tulpn | grep :3128
~# tail -f /var/log/squid/access.log
~# tail -f /var/log/squid/cache.log

Content credit: 3gp mobile movies