Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

229
Vistas
Vue-cli-plugin PWA can't generate cache storage content

vue.config.js

pwa: {
workboxPluginMode: 'GenerateSW',
workboxOptions: {
  importWorkboxFrom: 'cdn',
  skipWaiting: true, 
  clientsClaim: true,
  navigateFallback: '/index.html',
  include: [

  ],
  runtimeCaching: [
    {
      urlPattern: /.*\.js.*/i,
      handler: 'CacheFirst',
      options: {
        cacheName: 'seed-js',
        expiration: {
          maxEntries: 20,
          maxAgeSeconds: 30 * 24 * 60 * 60, // 30 days
        },
      },
    },
    {
      urlPattern: /.*css.*/,
      handler: 'CacheFirst',
      options: {
        cacheName: 'seed-css',
        expiration: {
          maxEntries: 30,
          maxAgeSeconds: 30 * 24 * 60 * 60, // 30 days
        },
      },
    },
    {
      urlPattern: /.*(png|svga).*/,
      handler: 'CacheFirst',
      options: {
        cacheName: 'seed-image',
        expiration: {
          maxEntries: 30,
          maxAgeSeconds: 30 * 24 * 60 * 60, // 30 days
        },
      },
    }
  ]
}

When I disable production only service worker, and execute 'npm run serve'

import { register } from 'register-service-worker'

// if (process.env.NODE_ENV === 'production') {
  register(`${process.env.BASE_URL}service-worker.js`, {
    ready() {
      console.log(
        'App is being served from cache by a service worker.\n' +
        'For more details, visit https://goo.gl/'
      )
    },
    registered() {
      console.log('Service worker has been registered.')
    },
    cached() {
      console.log('Content has been cached for offline use.')
    },
    updatefound() {
      console.log('New content is downloading.')
    },
    updated() {
      console.log('New content is available; please refresh.')
    },
    offline() {
      console.log('No internet connection found. App is running in offline mode.')
    },
    error(error) {
      console.error('Error during service worker registration:', error)
    }
  })
// }

Finally, I got nothing in cacheStorage, which can be fetch under offline condition, but with successfully registed service worker, . So straightforward I got nothing during offline. Why? I surly I got the right url pattern string.

cache storage

service worker

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda