Name

cache_dir

Synopsis

This directive instructs Squid where, and how, to store cached objects on disk. See Section 7.1 for the details on cache directories.

The second parameter selects the storage scheme. Your choices are ufs, aufs, diskd, coss, and null. To use any scheme other than ufs, you must use the --enable-storeio option with ./configure. See Section 3.4.

The third parameter is the amount of disk space to use for the cache. The units are in megabytes.

The fourth and fifth parameters are the number of L1 and L2 directories. Don’t change these values for directories that already contain cached objects.

Some cache_dir schemes have additional, optional parameters. Refer to the scheme-specific sections in Chapter 8.

Syntax

cache_dir scheme 
                              directory 
                              size-MB 
                              L1 
                              L2 [options...]

Default

cache_dir ufs $prefix/var/cache 100 16 256

Example

cache_dir ufs /cache0 3072 16 128

Related

cache_replacement_policy, cache_mem

Get Squid: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.