earlyHints

  • Property Manager name: Early Hints
  • Behavior version: The v2024-05-31 rule format supports the earlyHints behavior v1.0.
  • Rule format status: GA, stable
  • Access: Read/Write
  • Allowed in includes: Yes

Use Early Hints to send an HTTP 103 status code with preliminary HTTP headers at the client request stage, so that a browser can preload critical website resources or preconnect to a specific domain while waiting for the final response.

The 103 response occurs only when the Sec-Fetch-Mode request header's value is navigate. Since this is a default setting that's already a part of the behavior's logic, you don't need to set any additional match criteria. However, if you add this behavior to a rule where a request​Header criteria matches a Sec-Fetch-Mode value other than navigate, you get a validation error.

See the Property Manager guide for more caveats, examples, and implementations using Edge​Workers.

OptionTypeDescriptionRequires
enabledboolean

Enable the behavior so that browsers can use that waiting time to preload the resource URLs you specify or preconnect to static or image domains.

{"displayType":"boolean","tag":"input","type":"checkbox"}
resource​Urlstring (allows variables)

Enter the URL to a resource you want clients to receive as an early hint. Edge servers include each resource URL you provide in an instance of the Link header that's sent back to the client in the HTTP 103 response. You only need to specify the value of the header, as edge servers automatically add the Link header name to the response. Use commas to separate multiple entries. This field supports variables and string concatenation. The URL must be enclosed between < and > as shown in the example below.

Example: <https://cdn.​example.​com/assets/main1.​css>;rel=preload;as=style, <https://cdn.​example.​com/assets/main2.​css>;rel=preload;as=style

{"displayType":"string","tag":"input","type":"text"}
{"if":{"attribute":"enabled","op":"eq","value":true}}