feat: return 410 status code on missing JS assets#2542
Conversation
|
🗑️ Preview for this PR was deleted. |
There was a problem hiding this comment.
Pull request overview
Updates the Nginx reverse-proxy configuration for the Apify docs sites to return 410 Gone (instead of 404 Not Found) when hashed Docusaurus JS/CSS assets are missing, helping crawlers and caches stop requesting stale bundles after deployments.
Changes:
- Adds a shared named location that returns HTTP 410 and maps upstream 404s for hashed assets to it.
- Introduces dedicated regex
locationblocks for/assets/js/*.jsand/assets/css/*.cssin the main docs site and each proxied sub-site (/sdk/*,/api/client/*,/cli).
|
For the record, this doesn't seem to have helped (see, e.g., the response to https://docs.apify.com/assets/js/abc.js ) |
|
I think nginx takes a while to start working properly (or at least it did for regular 301's I was doing so maybe here is the same case? I'll observe this for the next day/two and see how it behaves) |
|
nginx is fast, but there is a CDN in front of it, which takes a bit. last time I was battling something here, I tried 7 different variants before surrending, only to see the other day that it actually worked. |

As per the findings of the SEO team:
Returning
410 Goneinstead of404 Not Foundon regenerated JS assets should send a stronger signal that the asset path is no longer valid to the consumer.