-
Notifications
You must be signed in to change notification settings - Fork 28.3k
Next.js prefetching should use requestIdleCallback #14463
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
Comments
I'll give it a try. |
@Timer Should we disable prefetching in case of those browsers which don't support requestIdleCallback? |
I have a page that contains around 50-100 links to other pages (a site map). When prefetching starts because of the links being in the viewport, everything starts to freeze in subsequent page visits, as the server has to start answering potentially 100 requests at the same time. The server might be weak if this causes problems, but in a scenario where multiple users would go to this page, the no. of requests would be significant to probably strong enough servers as well. My question is if this is going to help, or should I implement something like prefetching on hover instead? |
Please verify that your issue can be recreated with Why was this issue marked with the
|
This issue has been automatically closed because it wasn't verified against next@canary. If you think it was closed by accident, please leave a comment. If you are running into a similar issue, please open a new issue with a reproduction. Thank you. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Our prefetching should use
requestIdleCallback
to prevent registering every single intersection observer tag in viewport at once. This will ensure we don't introduce first input delay during hydration.We can look at
quicklink
for inspiration.The text was updated successfully, but these errors were encountered: