Offline support / service worker
Tab PWA Offline / Service Worker in the site configuration.
Service worker and offline fallback page in the site configuration
| Name | Type |
|---|---|
| boolean | |
| string (link) |
-
- Type
- boolean
- Default
- false
Label Enable service worker / offline support. If enabled, a script that registers the service worker is added to the
<head>of every page.
-
- Type
- string (link)
Label Offline fallback page. Page shown when a page navigation fails because there is no network connection. If empty, WitPwamanifestStartUrl is used. If WitPwamanifestStartUrl is empty too,
/is used.
Behaviour
- The script is delivered via
typewith the headerNum = 836 Service-and registered withWorker- Allowed: / scope: '/'. No route enhancer and no file in the document root are required. - Install: the offline fallback page is stored in the cache
wit-.pwa- offline- v2 - Activate: all other caches of the origin are deleted.
- Page navigation: network first. If the request fails, the cached offline fallback page is returned.
- Styles, scripts, fonts and images: cache first. Successful responses are stored in the cache when they are requested for the first time. Assets requested before are served from the cache, also offline.
- Requests other than
GETand requests with a scheme other thanhttp/https(for example from browser extensions) are not handled. - The scope
/covers the whole origin, including the TYPO3 backend under/typo3/. Backend styles, scripts, fonts and images are therefore stored in the cache as well.
Important
The service worker is intentionally minimal: there is no configurable caching strategy and no cache versioning per deployment.
Assets are cached by their full URL. TYPO3 adds the file modification time
to asset URLs (for example backend.), so a changed
file gets a new URL and is loaded from the network. The entry for the old
URL stays in the cache until the cache name changes in a new extension
version.
Disable the service worker
Disabling the option only stops the registration on new page loads. A service worker that is already installed in a browser stays active until it is unregistered (for example via the browser developer tools).