Make expiryDate bust cache #8525
-
Just ran into this issue when refactoring an old Craft 2 site. Basically, our client uses news posts to post specials that show up on the homepage. When they're no longer relevant, they need to no longer display on the homepage and go to archived posts.
I couldn't find anything on this functionality changing for Craft 3, but maybe I missed something. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Why isn't this a solution for you https://docs.craftcms.com/v2/templating/cache.html#until |
Beta Was this translation helpful? Give feedback.
-
I'm not dealing with a single entry. It's a general list of featured entries on the homepage, that can expire. I'd have to do something like loop through my entries to find the next expiry date if one exists, then set a couple different cache settings depending on whether any of the active posts have expiry dates. It just seems like this built in field should notify the template that it has changed so the cache is automatically cleared. Just like on a save of an active entry or when publishing a new entry. |
Beta Was this translation helpful? Give feedback.
-
Related: #978 |
Beta Was this translation helpful? Give feedback.
-
Added smart cache busting based on entry expiry dates, for Craft 4.3 (#11901) 🎉 |
Beta Was this translation helpful? Give feedback.
Added smart cache busting based on entry expiry dates, for Craft 4.3 (#11901) 🎉