Skip to content
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

Add fetchpriority="high" to <script /> for loading async js source #17392

Closed
xingxinglieo opened this issue Jun 16, 2023 · 2 comments
Closed

Comments

@xingxinglieo
Copy link

For example, if you load an asynchronous route, the JS load after the first screen is a low-priority load, and then your chunks are split into dozens of chunks, then you will be blocked by some requests.The most serious problem is that the chunks are cached locally by the browser, but it takes hundreds of milliseconds to load them
see Network requests stuck in pending state

image
to resolve: script.setAttribute("fetchpriority","hight")
see MDN

@alexander-akait
Copy link
Member

alexander-akait commented Jun 16, 2023

Sorry, no, we don't want to change default behaviour, we have #17249 if you want to set it, you can set it globally for all chunks

@xingxinglieo
Copy link
Author

The problem has been solved, the option is a good way to solve, thank you for the answer

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

No branches or pull requests

2 participants