Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
How do I add the Workbox Broadcast Update plugin to my Workbox config?

I am using GenerateSW() to add a service worker to my javascript application.

import { generateSW } from 'rollup-plugin-workbox'
import workboxConfig from './workbox-config.js'

generateSW(workboxConfig)

I would like to use the Broadcast Update feature of the service worker to notify users when a cached resource has been updated but I'm not sure how to add the plugin given my workbox config file:

import path from 'path'

const config = {
  swDest: path.join(__dirname, 'dist', 'sw.js'),
  globDirectory: path.join(__dirname, 'dist'),
  globPatterns: ['**/*.{html,js,css,svg,png,jpg,jpeg,woff2,json}'],
  runtimeCaching: [
    {
      handler: 'StaleWhileRevalidate',
      urlPattern: /^https:\/\/.*.jwm.com\/v1\/catalogs/,
      options: {
        cacheName: 'catalogs',
        cacheableResponse: {
          statuses: [200]
        },
        expiration: {
          maxAgeSeconds: 60 * 60
        }
      }
    }
  ]
}

export default config
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!