-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Busting cache on endpoint/element changes #47
Comments
Okay, so a bit of an update on this. I was able to accomplish this by busting the cache using a custom (simple) plugin init function that listens for the
This works great, however there is no way of checking if the status changes / entry expires via the TasksService. I have tried a few things including checking the actions with
Any help or guidance on how to hook into the TasksService event for this would be greatly appreciated! |
Hey @AwakenTheJaken, I've had the same problem and I thought it would be helpful if I created a plugin for this. https://straightupcraft.com/craft-plugins/cache-buster-for-elementapi Greets, |
Hey thanks for the reply, however I built pretty much the same thing to solve the issue. This approach works fine, but falls short when items need to be expired ( EG: a Promotions page). 👎 Looks like there is no way of doing this unless you want to hack the core files. The cache itself doesn't care for expiration dates of individual entries, just what you feed it. Hope this helps someone going down the same path. |
There is a Craft 3 plugin which will trigger events when entries are published at a future date. I haven't attempted to implement it yet and there is no documentation but it's worth looking into. It's also in their roadmap to add events for expired entries. |
Is there any way to turn caching on, but bust the cache when that endpoint/element changes through the cms? At the moment the caching is working great, but I have to manually bust the cache any time anything on the cms side changes. Is this the expected behavior and if not -- am I missing something here?
Thanks so much for the absolutely AWESOME plugin.
The text was updated successfully, but these errors were encountered: