Issues with S3 Cache Cleanup in OnlyOffice Document Server Integration

Hello @leandro

Document Server indeed should clean specific items from cache in 24 hours. However, please note that the clean-up is initialized according to the cron job that checks PostgreSQL database for any items older than 24 hours. It is important to keep in mind that in the table task_result has two colums: created_at which defines first opening of the document and last_open_date which defines last opening date of the document. When cron job is executed, it looks for the records of the last_open_date column and checks if the time specified there for items in cache is more than 24 hours, then cleans up cache. Considering it, if you are accessing files after the first opening, then the date refreshes and during a clean-up Document Server skips the items that are not older than 24 hours. Also, just a side note, Document Server during a clean-up also checks table doc_changes and, if there are any records for specific item, it also skips them.

You can check records in database by connecting to it with psql -U <username> -h localhost (username is located in local.json config), then entering the password that is also located in local.json, then using SELECT * FROM task_result; and SELECT * FROM doc_changes; queries to print out contents of these tables.

Please do not manually modify records in the tables as it may cause various issues with Document Servers’ functionality.

I hope it helps.