Skip to main content

Cleaning Disk Cache Job

clean.png

This job is used to clean the disk cache.

Disk cache is a directory on a disk where diagram images are stored so that they can be viewed quickly by users.
Some image files created a long time ago may no longer matter. They take up disk space unnecessarily and can be removed.

The first of two “Safety Gap Seconds” parameters protects the youngest (latest) files from being deleted. 
For example, the default value of 86400 (which is 60*60*24 s) says that files created in the last 24 hours will not be cleaned (deleted), even if their total disk size exceeds the limit (given by the second parameter).

safety-gap-seconds.png

The second “Disk Size Limit Bytes” parameter says what is the maximum total size of files on the disk after cleaning. 
The job sorts the image files according to the time they are created and gradually deletes them from the oldest ones until the rest take up less disk space than this limit. 
However, if even too “young” files (according to the first parameter) should be deleted, the deletion will end, and the files will take up more space on the disk.

disk-size-limit.png

Between runs of this job, it is not monitored (nor regulated) that the files on the disk do not take up much space.

It is advisable to set the size of the “Disk Size Limit Bytes” parameter so that the image files generated by the “Regenerate Missing Image” just fit into the disk limit. If the size limit is lower than the size of images, there is a constant cyclic (i.e. unnecessary) generation and deletion of the same images. 
If a diagram image is already stored on the disk, then its regeneration (of course, if its model has not been extended) no longer requires additional disk space.