Cache files are not cleared

Hello @technique

Firstly, let me elaborate on two main values for the cache check:

  • expire.files - defines the time of life for the folders in App_Data;
  • expire.filesCron - defines the time for check starting (every hour by default).

Basically, every hour Document Server performs cron check for the files in cache that are older than 24 hours, if such found, Document Server deletes them. However, there are certain cases where such rule does not apply, I’ve described it here:

As for the forgotten folder: in this folder Document Server stores files that were not saved back to the storage due to an error. For instance, when leaving a document, Document Server waits few seconds and then stores the file back to the storage, but if for some reason storage does not respond with "error: 0", in this case Document Server stores the file in forgotten.
Basically, these files are there until recovered or removed manually. To recover them, you need to access the file with the same key as it had in the moment of saving failure. You can try tracing possible reasons why these files are in forgotten by the names of directories inside, as they represent document.key, in logs of Document Server. That might help in finding out what happened to the file and why it is in forgotten.

Also, enabling debug level logging might help getting more information about cron jobs and results. To enable it you must edit production.json config in /etc/onlyoffice/documentserver/log4js/ diretory by changing "level": "WARN" to "level": "DEBUG" and restarting Document Server services with systemctl restart ds-*.