Skip to content

Conversation

rschristian
Copy link
Member

@rschristian rschristian commented Jul 31, 2025

Netlify, via our config here, is set up to redirect all 404'ing requests to /404/index.html, which isn't unreasonable for most pages but our "guess and check" method of fetching translated content makes this a bit wasteful. In the event of a missing translation file, all we do is read the status code & discard the response body, which is the prerendered 404 page (~3kb w/ gzip):

if (!r.ok && lang != 'en') {
fallback = true;
return fetch(url.replace(/content\/[^/]+\//, 'content/en/'));

We could (and perhaps should) build a content manifest to skip some of these needless fetches, in the meantime, we can return a smaller asset at the very least. Reduces data egress & is likely faster for Netlify to respond with.

/guide/api-reference /guide/v10/api-reference
/guide/forms /guide/v10/forms
/guide/linked-state /guide/v8/linked-state
/guide/external-dom-mutations /guide/v8/external-dom-mutations
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Page was removed from v10 in #1253, overlapped a lot with the refs page.

@rschristian rschristian marked this pull request as ready for review August 1, 2025 06:47
@rschristian rschristian merged commit 0d52a6d into master Aug 1, 2025
5 checks passed
@rschristian rschristian deleted the refactor/redirects-on-404 branch August 1, 2025 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants