8.7 The null Storage Scheme

Squid has a fifth storage scheme called null. As the name implies, this is more of a nonstorage scheme. Files that are "written" to a null cache_dir aren't actually written to disk.

Most people won't have any reason to use the null storage system. It's primarily useful if you want to entirely disable Squid's disk cache.[4] You can't simply remove all cache_dir lines from squid.conf because then Squid adds a default ufs cache_dir. The null storage system is also sometimes useful for testing and benchmarking Squid. Since the filesystem is typically the performance bottleneck, using the null storage scheme gives you an upper limit of Squid's performance on your hardware.

[4] Some responses may still be cached in memory, however.

To use this scheme you must first specify it on the enable-storeio list when running ./configure:

% ./configure --enable-storeio=ufs,null ...

You can then create a cache_dir of type null in squid.conf:

cache_dir /tmp null

It may seem odd that you need to specify a directory for the null storage scheme. However, Squid uses the directory name as a cache_dir identifier. For example, you'll see it in the cache manager output (see Section

    Appendix A. Config File Reference