Offline and repeat visits
This page is for owners, support staff and administrators of sites where visitors come back often: news, catalogs, member sites, store front pages. Exponential can let the visitor's own browser answer a repeat page visit at once and refresh the page in the background. This page explains what that gives you, the rules that keep it safe, the one effect your support team must know, and how to switch it off. It is optional; nothing on your site depends on it.
Contents
- What it does
- Why it helps
- What it never stores
- The "second view" effect
- Switching it off
- What it is not
- Questions for your team
What it does
The site's service worker is a small script, /index.js, "the one service worker script of an Exponential site"
(file header of index.js). Its first and, so far, only feature is the navigation cache: "repeat page visits
answered from the browser, refreshed in the background". /sw.js was its earlier name and remains as a one-line
script that loads /index.js, so browsers registered under the old name run the same code
(6.0.15 changelog).
The worker is registered "by the site design after page load"; the header of index.js names the media theme
(extension/sevenx_themes_media) as the design that does so. The hosting documentation describes it as part of the
setup "under Velocity" (Velocity response cache: the browser navigation cache).
Whether your site uses it therefore depends on your design and server: ask your team.
Why it helps
The source explains it with two measured numbers from one installation (The response cache, and getting out of the network's way):
| Measurement | Value |
|---|---|
| Network round trip to a real browser connection | 12.47 ms |
| The server's answer to the same request | 0.36 ms |
"A round trip cannot be shortened, only skipped." So the page is answered from the browser's own store, and the network is asked afterwards. These figures are the source's measurements on one server, not a promise for your site; the point for a business is that a repeat visit no longer waits for the network.
What it never stores
From the same source, the rules:
- only same-origin GET navigations (assets are already cached by the browser);
- never a page fetched with a session cookie, so a signed-in visitor's page is never kept;
- never anything but a successful page (200);
- never
/admin,/user,/explayouts_uior/api.
"If a session cookie appears, the page-side script unregisters the worker and clears its cache, rather than leaving it to serve one visitor another's page."
For a business this means: customer accounts, baskets, checkout and the administration are never answered from this cache.
The "second view" effect
The worker shows the stored copy first and refreshes it in the background, so "a published change appears on the second view, not the first". Tell your support team and editors:
| Question | Answer |
|---|---|
| "I published a correction and still see the old page" | Reload once more; the first view refreshed the copy |
| "A customer still sees the old price" | Their next visit shows the new one; signed-in customers are not affected |
| "It must change immediately for everyone" | Ask the administrator about the response cache and, if needed, the off switch |
The hosting checklist includes: "Support knows the navigation cache's 'second view' behavior."
Warning
For time-critical changes (a recalled product, a wrong price), plan with your administrator how to clear Velocity's response cache, and accept that a repeat visitor may see the old page once (Velocity response cache).
Switching it off
The documented kill switch: serve index.js as a script that unregisters itself. "Every browser drops it on its
next update check, within 24 hours, because index.js is no-cache." The file /sw.js must be kept until no browser
can still hold the old registration; removing it early "would leave those browsers on their last copy of the old
worker for good" (file header of sw.js).
What it is not
- Not an offline mode for the whole site. The sources describe a cache of pages a browser has already visited, not a site that works without a connection. Pages never visited are not there.
- Not an app. It needs no installation by the visitor and offers no notifications.
- Not a replacement for server caches. The response cache and HTTP caching still do the main work (Caching for availability).
Questions for your team
- To do: Does our design register the service worker, and on which siteaccesses?
- To do: Is
/index.jsserved with revalidation (the source lists it among paths that are "always revalidated")? - To do: Does support know about the second view?
- To do: Who can switch it off, and how quickly?
- To do: Is
/sw.jsstill in place for older registrations?
Related pages
- App backend reliability
- Responsive sites
- Static and response cache
- Velocity response cache
- The response cache, and getting out of the network's way
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.