← Back to release summary

Speculation rules: eagerness field

Category
Miscellaneous
Type
New or changed feature
Status
Enabled by default (Chrome 121)
Intent stage
None

Summary

To make the web user experience more instant, the user agent (UA) could pre-connect to the server, prefetch resources, or prerender them ahead of time. These actions are referred to as preloading actions. Since performing any preloading action may cause side effects (e.g. log the user out) and has an overhead (e.g. extra data/cpu usage), to perform the action the UA should know if the action is safe to perform and also if it is worth performing. Being able to consistently determine which actions are safe for a given target without feedback from the developer is not an easy task. Speculation rules expose the necessary API to let developers specify that. Adding the eagerness field to the speculation rules will let the developers control how eagerly the browser preloads links in order to balance the performance advantage against resource overhead. This field accepts one of "conservative", "moderate" or "eager" strings as the value, and it is applicable to both "prefetch" and "prerender" actions and both "list" or "document" sources. If not explicitly specified, list rules default to "eager" and document rules default to "conservative".

Standards & signals

View on chromestatus.com