> PWA with Workbox

Production-grade PWA caching with Google Workbox and Vite PWA plugin.

fetch
$curl "https://skillshub.wtf/skillshub-team/catalog-batch5/pwa-workbox?format=md"
SKILL.mdPWA with Workbox

Workbox PWA

Vite PWA Plugin

npm install vite-plugin-pwa
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
    plugins: [VitePWA({
        registerType: 'autoUpdate',
        workbox: {
            globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
            runtimeCaching: [
                { urlPattern: /^https:\/\/api\./, handler: 'NetworkFirst',
                  options: { cacheName: 'api', expiration: { maxEntries: 50, maxAgeSeconds: 300 } } },
                { urlPattern: /\.(?:png|jpg|svg|webp)$/, handler: 'CacheFirst',
                  options: { cacheName: 'images', expiration: { maxEntries: 100 } } },
            ],
        },
    })],
});

Workbox Strategies: CacheFirst, NetworkFirst, StaleWhileRevalidate, NetworkOnly, CacheOnly

Background Sync for offline form submissions

Precaching for app shell

┌ stats

installs/wk0
░░░░░░░░░░
first seenMar 18, 2026
└────────────

┌ tags

└────────────