Turn off the on-disk caching to improve performance

September 12, 2011 • Customer Services       
Synopsis

This article explains how to disable the on-disk web cache (squid) to increase performance of the CensorNet Professional proxy

Article

Disabling the on-disk web cache speeds up browsing because the squid proxy does not have to write to the disk so often.

By default the on-disk web cache is enabled and on most networks this is fine, however if you have a very large network, a slow disk controller/hard disk or you're noticing problems with browsing speed, then disabling the on-disk web cache is an option.

The method is slightly different depending on what version of the 'squid' proxy server is running on your CensorNet server. To find out, log in to the command line as root and type:

squid -v

The response should either by v2.6 or v2.7.

 

Disabling the on-disk cache for squid 2.6

Open the squid.conf file using an editor:

nano /etc/squid/squid.conf

Search for the term /var/spool/squid by holding down Ctrl and pressing W and then typing: /var/spool/squid and press enter. It should take you to a like like this:

cache_dir aufs /var/spool/squid 5000 32 256

Change this line to read:

cache_dir null /tmp

Now save and exit the editor with Ctrl+X and then Y then Enter.

You now need to stop and start the squid process, with the following two commands:

/etc/init.d/squid stop

/etc/init.d/squid start

On-disk caching is now disabled.

 

Disabling the on-disk cache for squid 2.7

Open the squid.conf file using an editor:

nano /etc/squid/squid.conf

Search for the term /var/spool/squid by holding down Ctrl and pressing W and then typing: /var/spool/squid and press enter. It should take you to a like like this:

cache_dir aufs /var/spool/squid 5000 32 256

Change this line to read:

#cache_dir aufs /var/spool/squid 5000 32 256

e.g. you have put a # at the start of the line to comment it out.

Now save and exit the editor with Ctrl+X and then Y then Enter.

You now need to stop and start the squid process, with the following two commands:

service squid stop

service squid start

On-disk caching is now disabled.

 

Related articles


Last modified on Mon, September 12, 2011 « Back