Skip to content

Add expire mechanism for preview images #45962

@alx-tuilmenau

Description

@alx-tuilmenau

How to use GitHub

  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Is your feature request related to a problem? Please describe.
There are a lot of issues here targeting the grow of the preview folder in appdata.. I would suggest a mechanism to add a expire date for it.

Describe the solution you'd like

  • add a config.php option 'preview_expire' with the number of months to keep preview images, 0 disables the function
  • using a real atime on preview images is not an option, because it will create a lot of load. So I will suggest to check the mtime of the preview image (from oc_filecache) on access. Only if this is older than half/third of the expire period, I will suggest to set it to the current timestamp (and maybe "touch" the file if necessary)
  • in a background job, all preview images older then the expire period according to the mtime should be removed (together with empty folders in the preview tree)

Describe alternatives you've considered
At the moment, I use an ugly external script to delete images, oc_filecache entries and empty folders of preview images older then 12 months.

Metadata

Metadata

Assignees

Projects

Status

🏗️ In progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions