Skip to main content
Version: 3.36.0

FetchEvent.sendEarlyHints()

The sendEarlyHints() method allows you to send a 103 Early Hints response back to the client which made the incoming request to your application.

Syntax

sendEarlyHints(headers)

Parameters

  • headers
    • : Any headers you want to add to your response, contained within a Headers object or object literal of String key/value pairs.

Return value

Always returns undefined.

Examples

event.sendEarlyHints({ link: '</style.css>; rel=preload; as=style' });

event.sendEarlyHints([
['link', '</style.css>; rel=preload; as=style'],
['link', '</style2.css>; rel=preload; as=style']
]);