Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document-Policy: expect-no-linked-resources #1014

Open
1 task done
alexnj opened this issue Nov 14, 2024 · 1 comment
Open
1 task done

Document-Policy: expect-no-linked-resources #1014

alexnj opened this issue Nov 14, 2024 · 1 comment
Assignees
Labels
Progress: propose closing we think it should be closed but are waiting on some feedback or consensus Topic: performance

Comments

@alexnj
Copy link

alexnj commented Nov 14, 2024

こんにちは 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 linked 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: WHATWG
  • 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:
    • Feedback from Mozilla that Gecko does have a single pass speculative parser integrated into document parser, and that this is likely only applicable to WebKit and Chromium who have two separate passes. We do think however that Gecko could choose to ignore the hint if such a performance optimization based on the hint is not possible or not necessary.
    • There is feedback from Mozilla and WebKit around the correctness of relying on hints 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 directly 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 configuration point, to avoid controlling the scanner behavior directly, and to create a reusable signal that might benefit more use cases.
@plinss plinss added this to the 2025-01-13-week milestone Jan 13, 2025
@torgo torgo added Topic: performance Progress: propose closing we think it should be closed but are waiting on some feedback or consensus labels Jan 27, 2025
@torgo
Copy link
Member

torgo commented Jan 27, 2025

Thanks for sending this our way. The explainer is clear and we understand the articulated user need. Our overall feedback is that we don't have strong concerns about it, but we are worried about adding complexity to the web platform in order to only support a very small number of web sites. This is aligned with our "prefer simple solutions" design principle. A question on venue: Will this work eventually go the web performance working group? This feels like a performance optimization and so should be aligned with the work there. In general you should have a plan for where this work goes after WICG (assuming you intend to take it to WICG).

@torgo torgo assigned torgo and unassigned plinss Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Progress: propose closing we think it should be closed but are waiting on some feedback or consensus Topic: performance
Projects
None yet
Development

No branches or pull requests

4 participants