Cloud Computing Insider Awards 2022: Vote for ONLYOFFICE

How long is the file obtained through key saved in docker?

Hello, I found the downloaded files and change information in the /var/lib/onlyoffice/caches/files path in the container after uploading the files. How long can these files be kept? What is the relationship between these files and the key? Why can some files be saved for a long time and some files disappear soon? In addition, how is the key of a document saved in onlyoffice? I’m so confused.

After a file is successfully saved after editing, it is stored in the Document Server’s cache for 24 hours. Same goes for its key in the psql database.

Hi, thanks for your answer. But the strange thing is that I found binary related files in the /var/lib/onlyoffice/cache/files/xxxxxx directory. These files didn’t disappear after 24h of creation, because they kept open in the browser? Or does the key expire 24h after all pages are closed?

The editing session ends when the last editing user closes the editor tab in the browser. When this happens, the document server builds the final version from Editor.bin and changes stored in PostgreSQL database and sends the download link to the callback handler. Then, 24 hours after that, the file is removed from cache and the database entry with its key is cleared.

So what file can I modify to change the expiration time

Cache lifetime is adjusted via expire.files parameter in /etc/onlyoffice/documentserver/default.json.
Default value is 86400 seconds (24h). You can also adjust the cron rule for file removal with expire.filesCron.
Note: run supervisorctl restart all to apply the config changes.