Home

Issue: 1838

Changing prefetch and preload options (resourceHints)

[issue link]

Currently under the render section of nuxt.config.js there is an option resourceHints (boolean), which enabled (default) or disabled (by setting to false) which, based on the documentation:

Adds prefetch and preload links for faster initial page load time.

I have a rather large list of routes, and some routes that are only used by users that have certain roles/privileges.

It would be nice if:

  • prefetch could be disabled, while still having preload (for things like the common chunks) enabled.
  • Set a flag in the pages (similar to how scrollToTop is flagged), to enable/disble preload or, prefetch. for that particular page component
  • Specify chunknames (or grouping) for a set of routes (i.e. via the page component definition) to group several small pages into the same webpackChunkName file

99% of the my users cannot access administrative pages, so it is kind of a waste of b/w to pre-fetch those pages which will never be loaded by those users, without having to disable site-wide pre-fetching (which affects 100% of the users)

An other option would be able to group pre-fetches by a user speified parameter… say if someone accesses /admin (and isn’t re-directed/blocked by middleware), then all the child routes of `/admin would be listed/added in the head as prefetch links.

This feature request is available on Nuxt.js community (#c1652)