Spec-Zone.ru › HTTP

Headers: Service-Worker-Navigation-Preload

Service-Worker-Navigation-Preload header

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

  • Learn more
  • See full compatibility
>

The HTTP Service-Worker-Navigation-Preload request header indicates that the request was the result of a fetch() operation made during service worker navigation preloading. It allows a server to respond with a different resource than for a normal fetch().

If a different response may result from setting this header, the server must include a Vary: Service-Worker-Navigation-Preload header in responses to ensure that different responses are cached.

For more information see NavigationPreloadManager.setHeaderValue() (and NavigationPreloadManager).

Header type Request header
Forbidden request header No

Syntax

Service-Worker-Navigation-Preload: <value>

Directives

<value>

An arbitrary value that indicates what data should be sent in the response to the preload request. This defaults to true. It maybe set to any other string value in the service worker, using NavigationPreloadManager.setHeaderValue().

Examples

>

Service worker navigation preloading headers

The following request header is sent by default in navigation preload requests:

Service-Worker-Navigation-Preload: true

The service worker can set a different header value using NavigationPreloadManager.setHeaderValue(). For example, in order to request that a fragment of the requested resource be returned in JSON format, the value could be set with the string json_fragment1.

Service-Worker-Navigation-Preload: json_fragment1

Specifications

Specification
Service Workers Nightly>
# handle-fetch>

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
Service-Worker-Navigation-Preload 59 18 preview97 46 15.4 59 No 43 15.4 7.0 59 15.4

See also

  • HTTP Caching: Vary and Vary header
  • Service Worker API

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Service-Worker-Navigation-Preload

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API