Reputation: 732
I'm using nextJS for my new website, but SEO and speed of the site is of very importance matter for me. What I'm trying to do is prevent loading of extra resource files while I have no need for them. For example when I'm at the Home page, I do not need resources for faq or about page be loaded in the background. Is there anyway I can possibly prevent these extra loads on my site?
Thank you in advance
Upvotes: 4
Views: 4311
Reputation: 3259
afaik, next.js is prefetching js bundles for the pages linked from the given one. To disable prefetching you can use Link
with prefetch={false}
:
<Link href="/faq" prefetch={false}>
<a>FAQ</a>
</Link>
Upvotes: 7