Skip to content

Conversation

rschristian
Copy link
Member

@rschristian rschristian commented Aug 24, 2025

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.


Before After
Current filmstrip view PR filmstrip view

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.

@rschristian rschristian force-pushed the feat/preload-fetches branch 3 times, most recently from 4092bc4 to 9a3afba Compare August 24, 2025 22:58
Comment on lines +30 to +31
credentials: 'include',
mode: 'no-cors',
Copy link
Member Author

Choose a reason for hiding this comment

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

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',
Copy link
Member Author

Choose a reason for hiding this comment

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

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.

@rschristian rschristian marked this pull request as ready for review August 24, 2025 23:19
@rschristian rschristian force-pushed the feat/preload-fetches branch from 0885a35 to 9a3afba Compare August 25, 2025 01:46
@rschristian rschristian merged commit 493984b into master Aug 25, 2025
5 checks passed
@rschristian rschristian deleted the feat/preload-fetches branch August 25, 2025 16:48
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