The scratch-folder

ShimmerCat needs a directory in a local filesystem to store cached and pre-processed versions of the files which are served. We call that directory "the scratch folder".

The structure of this folder follows a fixed convention detailed in this document.

Default location

The scratch folder is created in the directory where ShimmerCat runs, with the name .shimmercat.loves.devs. It is possible to chose another name using the command line option --scratch-dir-name, but note that the option only affects the name of the folder, not its location. To change the folder's location, the option --working-dir can be used, which will also affect where ShimmerCat searches for the devlove.yaml file. The corolary is that a devlove.yaml file will always be next to its scratch folder, and yes, they are expected to hold a one-to-one relation at all times.

The folder is created the first time that ShimmerCat runs, and from there on it is just re-used. The scratch folder is populated and maintaned for the most part automatically, but sometimes ShimmerCat may need a bit of help from the user.

Contents of the scratch folder

Certificates

The certificates for the sites configured in the devlove.yaml are stored in the scratch folder with these names:

If the files above are not present, ShimmerCat populates them with development certificates.

Assets cache

The folder r-cache inside ShimmerCat's scratch folder is used for storing processed assets. For example, copies of CSS, JS and HTML files compressed with GZip and Brotli are stored there, as well as the SHA hash needed to create their etags.

For images, the cache also stores the progressive or interlaced breakpoints used by. When using content-disposition: use-json in a view, the cache also stores the compiled templates.

This folder is created automatically, and its contents are updated transparently every time you update the files of your site inside a root-dir folder.

However, it is a good idea to clear this folder between major upgrades of ShimmerCat. It may also be needed if a resource there becomes corrupt.

To clear the assets cache, stop ShimmerCat if it is running, delete redis-dump.rdb and the r-cache folder.

Redis files

ShimmerCat runs an instance of Redis internally (or connects to an externally running redis instance), and therefore a few files required by Redis are also stored in the scratch folder:

ShimmerCat uses database 0 inside the Redis instance, and keys are of reasonable length and unlikely to collide with other applications or with other ShimmerCat instances serving different sites.