Image Caching

By default, a maximum of 60 images are cached for 1 year. The supported image extensions extensions are as follows:

/\.(ico|png|jpe?g|gif|svg|webp|bmp)$/

This can be changed using the next configuration options

/config/packages/pwa.yaml
pwa:
    serviceworker:
        enabled: true
        src: "sw.js"
        workbox:
            image_cache:
                enabled: true
                max_age: 30 days
                max_entries: 200
                regex: '/\.(png|jpe?g|svg|webp)$/'

This cache is different from the Asset one as it corresponds to images that are not managed by Asset Mapper

Last updated