Disk cache - The Polipo Manual
Description: The Polipo Manual

Previous: Memory cache, Up: Caching

### 4.3 The on-disk cache

The on-disk cache consists in a filesystem subtree rooted at a location defined by the variable `diskCacheRoot`, by default `"/var/cache/polipo/"`. This directory should normally be writeable, readable and seekable by the user running Polipo. It should normally point at a local filesystem; however, using NFSv3 should be safe in most implementations, but NFSv2 is definitely not1.

Polipo will accept to use a read-only cache. Note, however, that using Polipo in this manner will prevent it from updating usage information of on-disk objects, which will make purge control problematic (see Purging).

If `diskCacheRoot` is an empty string, no disk cache is used.

The value `maxDiskEntries` (32 by default) is the absolute maximum of file descriptors held open for on-disk objects. When this limit is reached, Polipo will close descriptors on a least-recently-used basis, which will cause no harm other than a decrease in performance. This value should be set to be larger than the number of resources that you expect to be live at a single time; defining the right notion of liveness is left as an exercise for the reader.

The value `diskCacheWriteoutOnClose` (32KB by default) is the amount of data that Polipo will write out when closing a disk file. Writing out data when closing a file can avoid subsequently reopening and validating it, but causes unnecessary work if the instance is later superseded.

The integers `diskCacheDirectoryPermissions` and `diskCacheFilePermissions` are the Unix filesystem permissions with which files and directories are created in the on-disk cache.

#### Footnotes

[1] Polipo assumes that ``open(O_CREAT | O_EXCL)`' works reliably.