files/en-us/web/http/reference/headers/service-worker-navigation-preload/index.md
The HTTP Service-Worker-Navigation-Preload {{Glossary("request header")}} indicates that the request was the result of a {{domxref("Window/fetch", "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 {{HTTPHeader("Vary", "Vary: Service-Worker-Navigation-Preload")}} header in responses to ensure that different responses are cached.
For more information see {{domxref("NavigationPreloadManager.setHeaderValue()")}} (and {{domxref("NavigationPreloadManager")}}).
<table class="properties"> <tbody> <tr> <th scope="row">Header type</th> <td>{{Glossary("Request header")}}</td> </tr> <tr> <th scope="row">{{Glossary("Forbidden request header")}}</th> <td>No</td> </tr> </tbody> </table>Service-Worker-Navigation-Preload: <value>
<value>
true.
It maybe set to any other string value in the service worker, using {{domxref("NavigationPreloadManager.setHeaderValue()")}}.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 {{domxref("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}}
{{Compat}}