Skip to content

[Feature request] Improve shouldPrefetch default value #953

Closed

Description

@Mister-Hope

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 #952

Alternative

No response

Additional context

No response

Activity

  1. github-actions commented on Jun 23, 2022

    @github-actions

    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.

  2. github-actions commented on Jul 4, 2022

    @github-actions

    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.

  3. github-actions commented on Jul 18, 2022

    @github-actions

    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.

  4. added
    enhancementNew feature or request
    and removed on Jul 18, 2022
  5. pinned this issue on Sep 4, 2024
  6. Mister-Hope commented on May 8, 2026

    @Mister-Hope
    MemberAuthor

    This is a serious issue now for agents. A lot agents will stop reading the page if no valid content is obtained in first x rounds (kb size of content each turn).

    So a full list of assets is definitely reasonable now.

    We shall either:

    • false by default
    • only prefetch page assets that appears in navbar, sidebar and contents.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions