Next: Modifying the on-disk cache, Previous: Purging, Up: Disk cache

#### 4.3.3 Format of the on-disk cache

The on-disk cache consists of a collection of files, one per instance. The format of an on-disk resource is similar to that of an HTTP message: it starts with an HTTP status line, followed by HTTP headers, followed by a blank line (``\r\n\r\n`'). The blank line is optionally followed by a number of binary zeroes. The body of the instance follows.

The headers of an on-disk file have a few minor differences with HTTP messages. Obviously, there is never a ``Transfer-Encoding`' line. A few additional headers are used by Polipo for its internal bookkeeping:

- ``X-Polipo-Location`': this is the URL of the resource stored in this file. This is always present.
- ``X-Polipo-Date`': this is Polipo's estimation of the date at which this instance was last validated, and is used for generating the ``Age`' header of HTTP messages. This is optional, and only stored if different from the instance's date.
- ``X-Polipo-Access`': this is the date when the instance was last accessed by Polipo, and is used for cache purging (see Purging). This is optional, and is absent if the instance was never accessed.
- ``X-Polipo-Body-Offset`': the presence of this line indicates that the blank line following the headers is followed by a number of zero bytes. Its value is an integer, which indicates the offset since the beginning of the file at which the instance body actually starts. This line is optional, and if absent the body starts immediately after the blank line.