Skip to content

fix(gatsby): add app-data to preload list #21537

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

Merged
merged 3 commits into from
Feb 21, 2020

Conversation

wardpeet
Copy link
Contributor

@wardpeet wardpeet commented Feb 17, 2020

Description

Adding app-data to the <link preload list so we make sure to start our js execution as fast as we can.

This fixes a regression introduced by #16686

Doing this fix introduces us to the next problem: network congestion and bundle bloat. It's hard to explain on these graphs what to see but you should see images coming in faster and execution of js being done faster because app-data is instantly loaded. I also added video's so it makes it more visible what difference it makes

Gatsby before and after, not much difference but the graph shifts a little.
webpagetest comparison
video

Third and grove is a bitter better too
webpagetest comparison
video

When there is no network congestion we can see that we're actually faster
webpagetest comparison
video

What's next?
Update netlify plugin to have http preload for page-data & app-data, it should make that a few 100ms faster and looks at our bundle sizes.

Related Issues

Fixes #21176

@wardpeet wardpeet requested a review from a team as a code owner February 17, 2020 21:23
@blainekasten
Copy link
Contributor

Does this config option affect this? https://www.gatsbyjs.org/docs/browser-apis/#disableCorePrefetching

@wardpeet
Copy link
Contributor Author

Does this config option affect this? gatsbyjs.org/docs/browser-apis/#disableCorePrefetching

Thanks for the reminder but no. This is only used when the page is loaded and we preload other pages. For example when you hit a page we prefetch all page-data's for links that are visible on the screen.

Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

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

LGTM

@pieh pieh merged commit ad92e13 into gatsbyjs:master Feb 21, 2020
@wardpeet wardpeet deleted the fix/preload-app-data branch February 21, 2020 14:54
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.

Difference in performance of site after updating Gatsby. (2.15.x - 2.19.x)
3 participants