-
Notifications
You must be signed in to change notification settings - Fork 21
Cache invalidation for scheduled Entries #1
Comments
We just discussed this on the Craft Slack. For Craft 2 I did this plugin. |
Perfect! @sjelfull |
So I’ve been thinking about this too, for Craft 2 I did a wider agnostic approach with Scheduler that does this but can also be extended to do anything else, like email someone a reminder in a week or whatever. |
The conceptual issue I’m having with delayed jobs in a queue is that what if the server gets rebooted or whatever, do they stay around? Can they be scheduled for a long time is the future, like a month or whatever? I appreciated you could use SQS or whatever, but there’s something nice and safe about a row in a db. |
@joshangell thanks for your input. |
@ostark Doesn't matter. You just publish a new job, and in the service you check if the entry is published/expired. |
Ok, @sjelfull, I'm happy to depend on your plugin 👍 |
Craft does not support it directly, but you can suggest/require your own dependencies, and they will be installed by composer. |
Pushed initial version in https://github.com/sjelfull/craft3-publishedevent |
In Upper 2.0
Added 29e4ec5 |
I just found this, and it seems to solve a problem I've been having. I see it's been merged into develop. Any change of getting it into a minor release in the near future? Or I guess an Upper 2 release. |
2.0 is a completely different code base. It's better than the 1.0 code, but also not completely happy - it's actually 2 years old. |
@ostark For When we're listening for elements to add their tags, if they have an |
@timkelty what if we have a list with multiple elements? |
@ostark as it iterated through the elements, it would just update the soonest expiry date (if it was sooner than the default) |
@ostark Craft now does this natively for its own cache: craftcms/cms#11901 |
Problem: Scheduled Entries do not purge the cache automatically.
Idea
A console command keeps an eye on
entries.postDate
andentries. expiryDate
. This command must be scheduled via cron to invalidated the cache without human interaction.The text was updated successfully, but these errors were encountered: