Skip to content

Navigation prefetching: not a good example nowadays? #42521

@ErwinHofmanRV

Description

@ErwinHofmanRV

MDN URL

https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/prefetch

What specific section or headline is this issue about?

#navigation_and_subresource_prefetches

What information was incorrect, unhelpful, or incomplete?

Prefetching of HTML pages might not be a good example anymore. Speculation Rules are a better mechanism for this.

What did you expect to see?

I expected to just see examples of prefetching static files. And if Navigation prefetches continues to be included, maybe a notice that Speculation Rules are a better alternative.

Do you have any supporting links, references, or citations?

https://developer.chrome.com/docs/web-platform/prerender-pages#no-cache

Unlike the older resource hint which just prefetched to the HTTP cache, documents loaded using speculation rules are processed in the same way that navigations are (but then not rendered) and are held in memory so will be available quicker to the browser once needed. This also allows documents which are not cacheable in the HTTP cache to be prefetched.

Due to issues with prefetching documents using , it is recommended to use speculation rules for navigations going forward, with only used for prefetching subresources. On the reverse side, speculation rules should be used for document navigation speculations and not for subresource prefetches, particularly given cross-origin restrictions of the Speculation Rules API.

Do you have anything more you want to share?

While I wanted to share this doc with a developer, I'm now a bit hesitant as they might spot the HTML prefetch and then start adopting that.

MDN metadata

Page report details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Content:HTMLHypertext Markup Language docsneeds triageTriage needed by staff and/or partners. Automatically applied when an issue is opened.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions