-
Notifications
You must be signed in to change notification settings - Fork 641
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
Newly added entries do not clear template cache which contains an entry query #2959
Comments
The template cache should get cleared by the “Delete stale template caches” background task. Is that running and completing for you, after saving the new entry? |
@brandonkelly Yes, the task runs and I can see it completing in the CP. For context I had this happen on a production site and managed to replicate across two other development sites and a fresh install of Craft 3.0.9. Also just tried a fresh install of 3.0.8 and it works fine, so looks like something in this latest version? |
Gotcha, thanks! Fixed now in 3.0.10.1 :) |
@brandonkelly — I'm actually experiencing the exact same issue @bendesilva described on Craft 3.4.19.1, the exact same flow:
Craft v 3.4.19.1 |
@poopsplat When a new entry is added, it’s up to the “Deleting stale template caches” background job to find any caches that should be deleted as a result, which can take some time to complete depending on the number of caches it has to go through, and how many entry queries they each contained. If you want something more immediate, check out the Cache Flag plugin. Or take a look at Blitz for full template caching, if your site doesn’t need to be dynamically generated for the most part. |
@brandonkelly — that makes sense, and thanks for the recommendations! 🙏 |
Description
A new entry created in a {% cache %} wrapped entries query (paginated or otherwise) does not clear the template cache as expected. Updating or deleting an existing entry within the same query does clear the cache.
Steps to reproduce
Additional info
The text was updated successfully, but these errors were encountered: