WP Tavern › Forums › Create Topic
Weston Ruter Rick: You can only have one service worker running at a time, and the first service worker to handle a `fetch` event will cause any other handlers to be skipped. So yes, only one service worker can manage the network request for a given URL. But a service worker could/should be conservative in the assets it caches, allowing multiple themes/plugins to control the caching for their own assets. But a service worker can do more than just manage the network. It can also manage notifications and do new things like background sync. So the ability for multiple themes/plugins to introduce their own respective JS code to include in the service worker is useful, and it needs a core API to facilitate it (by concatenating them together) since only one service worker can be installed at a time.
Weston Ruter
Rick: You can only have one service worker running at a time, and the first service worker to handle a `fetch` event will cause any other handlers to be skipped. So yes, only one service worker can manage the network request for a given URL. But a service worker could/should be conservative in the assets it caches, allowing multiple themes/plugins to control the caching for their own assets. But a service worker can do more than just manage the network. It can also manage notifications and do new things like background sync. So the ability for multiple themes/plugins to introduce their own respective JS code to include in the service worker is useful, and it needs a core API to facilitate it (by concatenating them together) since only one service worker can be installed at a time.
Name *
Email *
Website:
Topic Title (Maximum Length: 80):
Forum: — No forum —AI and WordPress Articles Blocks Showcase Discussions Events Introductions Jobs and Working in WordPress Podcast Episodes Site and Block Editor
Enter your email address to subscribe to this blog and receive notifications of new posts by email.
Email Address
Submit
Enter the destination URL
Or link to existing content