Developers · Best Practices
Service Workers
Last updated 1 November 2026
This guide covers the definition and functionality of Service Workers and detailed instructions on effectively employing them within the Insites.
Service Workers
A Service Worker is a background script that runs independently of web pages in your browser. It enables the implementation of features that do not require user interaction or the presence of a web page. Essentially, a Service Worker is a JavaScript file that operates on a separate thread from the main browser, intercepts network requests, caches or retrieves resources from the cache, and facilitates the delivery of push notifications.
Service Workers offer a range of capabilities that enhance web applications, including transforming an application into a Progressive Web App (PWA), sending push notifications, and improving performance through caching mechanisms. They introduce new web features that empower developers to create richer and more engaging web experiences.
Usage: Adding a Service Worker JavaScript file on root scope
Service Workers are limited to intercepting requests within their specified scope for security reasons.
For instance, if you have a Service Worker named
You can achieve this in Insites by placing your Service Worker files in the
(and ) (and )
Examples:
, ,
References
Please visit the following references for more information on Service Workers: