v149 · web api · shipped
Request.isReloadNavigation
A new read-only boolean on the Fetch API's Request interface that tells a service worker whether the intercepted navigation was triggered by a page reload — enabling reload-specific caching strategies like network-first or cache-bypass without heuristics.
at a glance
| Shipped in | Chrome 149 / Firefox (shipped) / Safari (shipped) |
|---|---|
| Status | Enabled by default |
| Flag | None |
| Spec | WHATWG Fetch — dom-request-isreloadnavigation |
| ChromeStatus | 5154214529597440 — Request.isReloadNavigation attribute |
why it exists
Service worker fetch event handlers intercept all navigation requests — but they can't natively tell a reload apart from a fresh forward navigation. The common workaround was reading event.request.cache and checking for "reload", or inspecting request headers for Cache-Control: no-cache, both of which are unreliable across browsers and request modes.
The deprecated FetchEvent.isReload property filled this gap in early service worker implementations, but it was removed from the spec because it lived in the wrong place (the event, not the request object). Request.isReloadNavigation is the standardised, interoperable replacement — available on any Request object, not just in a fetch event handler.
shape of the API
Request.isReloadNavigation
| Type | boolean — read-only |
|---|---|
true when |
The request was triggered by a page reload: user pressed the browser reload button, called location.reload(), or called history.go(0). |
false when |
Any other navigation type: link click, window.open(), address bar entry, back/forward traversal, or a non-navigation fetch. |
| Reset on copy | Constructing a new Request from an existing reload request resets isReloadNavigation to false. The flag belongs to the original navigation, not to derived requests. |
Related: Request.isHistoryNavigation
A companion boolean, isHistoryNavigation, is true when the request was triggered by a back/forward traversal (history.back(), history.forward(), history.go(n), browser history buttons). It shipped separately and has its own MDN reference page.
example
Network-first on reload, cache-first otherwise
// service-worker.js
self.addEventListener("fetch", (event) => {
if (event.request.mode !== "navigate") return;
if (event.request.isReloadNavigation) {
// User explicitly reloaded — serve fresh from network.
event.respondWith(
fetch(event.request).catch(() => caches.match(event.request))
);
} else {
// Regular navigation — serve from cache if available.
event.respondWith(
caches.match(event.request).then(
(cached) => cached ?? fetch(event.request)
)
);
}
});
Log reload rate to analytics
self.addEventListener("fetch", (event) => {
if (event.request.mode === "navigate") {
analytics.log("navigation", {
url: event.request.url,
isReload: event.request.isReloadNavigation,
isHistory: event.request.isHistoryNavigation,
});
}
});
Bypass service worker cache for reload only
self.addEventListener("fetch", (event) => {
const req = event.request;
// For reload navigations, skip the SW cache entirely.
if (req.isReloadNavigation) {
// Construct a new Request with cache: "no-cache" to force revalidation.
event.respondWith(fetch(new Request(req, { cache: "no-cache" })));
return;
}
event.respondWith(
caches.open("v1").then((cache) =>
cache.match(req).then((cached) => cached ?? fetch(req))
)
);
});
browser support
| Chrome | 149 |
|---|---|
| Edge | 149 (Chromium) |
| Firefox | Shipped |
| Safari | Shipped |
see also
- WHATWG Fetch spec — dom-request-isreloadnavigation
- MDN: Request.isHistoryNavigation — the companion property for back/forward traversals
- MDN: FetchEvent — service worker fetch event
- MDN: Service Worker API