Intent to Extend Experiment: Speculation Rules: prerender-until-script Action

13 views
Skip to first unread message

Chromestatus

unread,
1:08 AM (6 hours ago) 1:08 AM
to blin...@chromium.org, lin...@chromium.org, nhi...@chromium.org
Contact emails
lin...@chromium.org, vis...@google.com

Explainer
https://github.com/WICG/nav-speculation/blob/main/prerender-until-script.md

Specification
https://wicg.github.io/nav-speculation/prerendering.html#speculation-rule-set-prerender_until_script-rules

Design docs

https://docs.google.com/document/d/18Ny-OJ5kfyxkZ8h73OGigk8B3gDnoxjH34RVcvSo5Do/edit?tab=t.szm4nrdsfrjv

Summary
This extends speculation rules to introduce a new action called prerender_until_script. It is designed as an intermediate option between the existing prefetch (which only fetches the main document) and prerender (which fully renders the page and runs all scripts). This new action will fetch and parse a page, discover and download its subresources like images and stylesheets, but will pause all script execution. When the user navigates to the page, it activates, and all the deferred scripts are then executed in order. This allows for a near-instant page load for content-heavy sites without the performance cost or side effects of running analytics or third-party scripts prematurely.

Blink component
Internals>Preload>Prerender

Web Feature ID
speculation-rules

Search tags
speculationrules, prerendering, prefetch, nostateprefetch

TAG review
https://github.com/w3ctag/design-reviews/issues/1183

TAG review status
Not applicable

Origin Trial Name
PrerenderUntilScript

Goals for experimentation
- whether this feature work as expected on developers' sites. - whether it is safe to leave inline event handlers as it is on websites. Developers will be able to monitor the error rate of JavaScript execution, and provide feedback on that.

Chromium Trial Name
PrerenderUntilScript

Origin Trial documentation link
https://github.com/WICG/nav-speculation/blob/main/prerender-until-script.md

WebFeature UseCounter name
kSpeculationRulesPrerenderUntilScript

Risks


Interoperability and Compatibility
Other browsers do not implement this feature yet, but if should be safe because: 1. it is an optimization, so it should be no-op on other browsers 2. other browsers do not implement any of speculationrule actions yet.

Gecko: No signal

WebKit: No signal

Web developers: Positive (https://github.com/WICG/nav-speculation/issues/305) Web developers proposed that UA should implement an intermediate option between the existing prefetch and prerender actions.

Other signals:

Ergonomics
no

Activation
No. Developers should be able to easily try this feature by changing "prerender" to "prerender_until_script" following the explainer.

Security
It should be as safe as prerender action, as it pauses JavaScript execution during prerendering. One potential risk is the inline event handlers. inline event handlers will be executed normally during prerendering, it seems risky but we find websites usually put inline scripts before defining a inline event handler, and the inline script will make the parser be paused, therefore user agent has no chance to execute the inline event handlers. So, we think is is a low possibility risk, and would like to confirm with Origin Trial.

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

No information provided


Reason this experiment is being extended
1. Developers have reported that it is currently slower than prefetch. We suspect one of the reasons is that the Prerender2FallbackPrefetchSpecRules feature is not yet enabled by default. Since this feature is launching soon, we'd like to monitor our metrics once it goes live to see if performance improves. 2. Some developers says that they do not have enough bandwidth to work on it and they're moving slowly, so we'd like to extend the OT to wait for their feedback.

Ongoing technical constraints
We assume it is ok not to handle inline event handlers differently as for now most pages put <script> tag before inline event handlers. But if it happens, we need to refine the inline event handlers' execution logic.

Debuggability
As well as other speculationrule features, this feature shows its current status on devtools.

Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?
Yes

Is this feature fully tested by web-platform-tests?
Yes


Flag name on about://flags
prerender-until-script

Finch feature name
PrerenderUntilScript

Requires code in //chrome?
False

Tracking bug
https://issues.chromium.org/u/1/issues/428500219

Measurement
Blink.UseCounter.Features

Estimated milestones
Origin trial desktop first144
Origin trial desktop last150
Origin trial extension 1 end milestone154
DevTrial on desktop144
Origin trial Android first144
Origin trial Android last150
DevTrial on Android144
Origin trial WebView first144
Origin trial WebView last150


Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/6324676351623168?gate=5317079747133440

Links to previous Intent discussions
Intent to Prototype: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/68f20f78.050a0220.29f70d.004e.GAE%40google.com
Intent to Experiment: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/6965e5e2.050a0220.22847.035a.GAE%40google.com


This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
Forward
0 new messages