Delete few static cache pages on saving/updating entry #8573
-
Hi. I need a function which would trigger removing a few files (pages) in static cache folder when user creates a new entry or edits an entry. For example when user adds an entry to Collection NEWS (hits Publish or Update), function needs to run a function like: IF entry belongs to Collection NEWS, delete static cache pages X,Y,Z. I know the file names, but I'm not sure where I could trigger that function (and also get Collection name WHEN SAVING OR UPDATING entry). Thanks for ideas! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You could create a listener that listens for the We do something similar with a listener: https://steadfastcollective.com/articles/handling-statamic-static-cache-invalidation-on-large-sites |
Beta Was this translation helpful? Give feedback.
You could create a listener that listens for the
EntryCreated
/EntrySaved
events, then do your custom logic in the listener.We do something similar with a listener: https://steadfastcollective.com/articles/handling-statamic-static-cache-invalidation-on-large-sites