core icon indicating copy to clipboard operation
core copied to clipboard

[Feature request] Improve shouldPrefetch default value

Open Mister-Hope opened this issue 3 years ago • 3 comments

Clear and concise description of the problem

Currenly the shouldPrefetch: true default behavior have serious preformance impact on large sites with FCP time.

For a large site with around 1500 pages, shouldPrefetch link can take up to 30-50KB in each html entry.

Suggested solution

As @meteorlxy suggests earlier, we can change the default behavior to only prefetch assets which can be visited through the page.

Or more detailed:

  1. find all links in the page, (also home and 404)
  2. find all links in navbar and sidebar
  3. Combine them together with a link array
  4. Get all the preload links of them
  5. filter the duplicated ones
  6. Set them as default value of shouldPretch

But this requires improvments mentioned in https://github.com/vuepress/vuepress-next/issues/952

Alternative

No response

Additional context

No response

Mister-Hope avatar Jun 15 '22 04:06 Mister-Hope

This issue is marked as stale because it has not had recent activity. Issues marked with stale will be closed if they have no activity within 3 days.

github-actions[bot] avatar Jun 23 '22 01:06 github-actions[bot]

This issue is marked as stale because it has not had recent activity. Issues marked with stale will be closed if they have no activity within 3 days.

github-actions[bot] avatar Jul 04 '22 01:07 github-actions[bot]

This issue is marked as stale because it has not had recent activity. Issues marked with stale will be closed if they have no activity within 3 days.

github-actions[bot] avatar Jul 18 '22 01:07 github-actions[bot]