For some reason whenever I save my gallery I must clear the cache for the site to reflect the changes in front end.
I was hoping I can make a simple plugin which will delete system cache whenever I save a gallery album.
anyone have an idea how I can do it?
Thanks in advance...
What is your frontend code to display the gallery, maybe you can call the snippet !uncached?
TinymceWrapper: Complete back/frontend content solution.
Harden your MODX site by
passwording your three main folders:
core, manager, connectors and renaming your
assets (thank me later!)
5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
Thanks @donshakespeare, my snippet is call is indeed cached, the gallery is displayed on a public display screen 24/7/365, So I rather keep caching enabled as default and just force a cache delete when the gallery is saved to push the changes.
As of now I have added a link to manager dashboard to delete the system cache but its an extra step when can/should be automated.
I don't use the Gallery snippet, but when you save, is it a resource you're saving? If so it should be easy to create a plugin that checks the id of the page and clears the specific Gallery cache if it's the Gallery page.
If not, I doubt if Gallery fires any System Events that you could attach a plugin to. I could be wrong. If it doesn't you could probably create your own System Event and modify the Gallery code to fire it when you save.
gallery has its own cache-directory and should clear its cache, when saving items
https://github.com/modxcms/Gallery/blob/develop/core/components/gallery/model/gallery/galitem.class.php#L209
how do you call the galleries?
maybe inside nested cached chunks?