Warm route code during idle time to speed rendering new pages #21249
Unanswered
KyleAMathews
asked this question in
Ideas / Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The first time a page component is used requires its code to be parsed & evaled. This happens after a link to the page is clicked at the moment which means the user waits for the 10-300ms required for this.
Ideally this parsing & evaling happens before the link is clicked so the user doesn't experience any delay.
This could be done by a similar mechanism to how we prefetch page resources. When we predict a page might be visited & all its resources are loaded — we watch for quiet CPU time and then simulate rendering the page which would cause webpack to load the code & run it. Then when the page is actually visited, it'll be rendered as fast as possible.
Beta Was this translation helpful? Give feedback.
All reactions