-
-
Notifications
You must be signed in to change notification settings - Fork 547
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
Non-existent urls are statically cached #10863
Comments
Are you able to provide the full output of |
Sorry, updated above. |
We should be able to pass along to the |
@jasonvarga That would be perfect. Thanks! |
Actually... I'm just wondering if this would still cause unnecessary processing. The UrlInvalidated event would still be fired thousands of times, and so would my listener, even though it would perform no actions. It seems to me that these urls shouldn't be cached in the first place. Maybe it's fine. Just a thought. |
They intentionally get cached since #10294. If your 404 page is heavy - it might be because of a nav or who knows what else - you could easily make a site struggle by hitting different 404 pages. |
Bug description
I'm noticing that a lot of bad URLs, such as legacy URLs from WordPress and non-existent image paths, are being statically cached.
For example:
https://mysite.ie/app/uploads/2019/04/competitions-at-club-dublin-690x460.jpg
https://mysite.ie/media/good_foods.jpg
https://mysite.ie/wp-content/uploads/2018/06/Leopardstown_10-2.jpg
https://mysite.ie/sitemap.xml.gz
https://mysite.ie/swimming/wp-content/dir/erin1.PhP7
https://mysite.ie/index.php/index.php
It's become a small problem recently when I started listening to the UrlInvalidated event to automatically trigger caching as described here: #8902
My site only has about 250 entries but nearly 3500 UrlInvalidated events are caught by my listeners when the static cache is cleared by my static caching rules. It puts a lot of unnecessary strain on the server through queued jobs.
Can non-existent urls somehow be ignored by the static cache? All of the above urls return a 404 error. I assume they are old links from the original site on Google or other indexes.
Thanks.
How to reproduce
Add a listener to handle the UrlInvalidated event, as described here:
#8902
Non-existent urls will gather in the static cache over time on a live website.
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
The text was updated successfully, but these errors were encountered: