We are looking for a way to clear the media cache (generated thumbs) of the current page. Ideally by placing a button in the panel.
Has anyone done something like this?
We are looking for a way to clear the media cache (generated thumbs) of the current page. Ideally by placing a button in the panel.
Has anyone done something like this?
Check out the Janitor plugin: https://github.com/bnomei/kirby3-janitor
It allows you to define custom actions.
Do we have core functions in Kirby to clear the media cache or is this something weβd have to code ourselves?
Iβm not aware of a method that does that but you can just remove the complete folder as that is recreated anyway?
Edit:
You can unpublish files via the $file->unpublish()
method, which removes all published versions of a file.
This would allow you to remove files selectively (i.e. just the files in a given page), rather than clearing the complete folder.
Ah, thatβs what I was looking for β cool! Do I have to publish the files again to get new job files or will Kirby do this on next request?
The files are recreated when they are requested again.
Perfect, thanks