Skip to content

Instantly share code, notes, and snippets.

@alexnj
Created November 13, 2024 03:42
Show Gist options
  • Save alexnj/ad3a78ba687079aaaa5eb9c781885e6f to your computer and use it in GitHub Desktop.
Save alexnj/ad3a78ba687079aaaa5eb9c781885e6f to your computer and use it in GitHub Desktop.
TAG questionnaire

こんにちは TAG-さん!

I'm requesting a TAG review of expect-no-linked-resources Document-Policy.

User Agents have implemented speculative parsing of HTML to speculatively fetch resources that are present in the HTML markup, to speed up page loading. For the vast majority of pages on the Web that have resources declared in the HTML markup, the optimization is beneficial and the cost paid in determining such resources is a sound tradeoff. However, the following scenarios might result in a sub-optimal performance tradeoff vs. the explicit time spent parsing HTML for determining sub resources to fetch:

  • Pages that do not have any resources declared in the HTML.
  • Large HTML pages with minimal or no resource loads that could explicitly control preloading resources via other preload mechanisms available.

This proposal introduces a configuration point in Document Policy expect-no-linked-resources to explicitly state to the User Agent that it may choose to optimize out the time spent in such sub resource determination.

Further details:

  • I have reviewed the TAG's Web Platform Design Principles
  • The group where the work on this specification is currently being done: Google or WICG
  • The group where standardization of this work is intended to be done (if different from the current group): N/A
  • Major unresolved issues with or opposition to this specification:
    • There is feedback from Mozilla and WebKit around the correctness of relying on hint from the page or web developers. This is however not against the priority of constituencies and very similar optimization to say, preload directives. This improves the user experience, in terms of perceived performance and reduced computation needs on the user's browser by actioning the hint provided by the page about its nature.
  • This work is being funded by: Google

You should also know that:

  • There was an earlier version of the specification, which was a full HTTP header Prefer-No-Speculative-Parsing that direclty tried to control the speculative parser behavior. After consulting W3PerfWG, the header was renamed into expect-no-linked-resources and repositioned as a Document-Policy header, to avoid controlling the scanner behavior directly, and to create a reusable signal that might benefit more usecases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment