feat: Preload & deprioritize some fetches#1326
Merged
rschristian merged 2 commits intomasterfrom Aug 25, 2025
Merged
Conversation
4092bc4 to
9a3afba
Compare
rschristian
commented
Aug 24, 2025
Comment on lines
+30
to
+31
| credentials: 'include', | ||
| mode: 'no-cors', |
Member
Author
There was a problem hiding this comment.
It's essential that these are set to these specific values for Safari support.
Not entirely sure why this is, as it deviates from Chrome & FF, but it's been the case for going on 5 years now so I don't think the Safari team particularly cares about aligning. Here's an StackOverflow post about it.
Comment on lines
-23
to
+28
| fetch(`${baseUrl}release?repo=${repo}`, { credentials: 'omit' }) | ||
| fetch(`${baseUrl}release?repo=${repo}`, { | ||
| credentials: 'include', |
Member
Author
There was a problem hiding this comment.
I'm lacking the context for why credentials: 'omit' was set (as the blame has none), but it shouldn't be an issue for us as we're not directly fetching from the GitHub API, it always passes through our lambda/approximation of a lambda (when running locally). Request & Response headers/cookies won't make it through that layer.
0885a35 to
9a3afba
Compare
JoviDeCroock
approved these changes
Aug 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We have a number of known static assets/fetches that we can preload to more quickly finish loading all resources, and as we're prerendering, most of this can actually be kicked down to low priority;
fetch, by default, is high priority yet none of these are actually essential for first load.Unfortunately Chrome still doesn't support preloading SVG sprites, it'd duplicate the request which is just a net negative, but that'll be another good addition when they do.
There's some discrepancies between the live & preview envs (which I used to generate this), so not quite apples-to-apples, but not super far off either.