From 1.4.x to 1.5.0

This page describes the changes you need to make when upgrading from version 1.4.x to 1.5.0.

Breaking Changes

Default Caching Strategy Changed

The default resource cache strategy has been changed from NetworkFirst to StaleWhileRevalidate.

Impact: Pages will now load instantly from cache while updating in the background, instead of waiting for the network first.

If you rely on NetworkFirst behavior, explicitly set it in your configuration:

config/packages/pwa.yaml
pwa:
    serviceworker:
        workbox:
            resource_caches:
                - match_callback: 'navigate'
                  strategy: 'NetworkFirst'

Broadcast Default Changed

The broadcast option for StaleWhileRevalidate resource caches now defaults to true (was false).

Impact: Clients will be notified via BroadcastChannel when cached content is updated in the background. This is generally desirable for StaleWhileRevalidate but may trigger unexpected behavior if you listen to broadcast events.

Deprecated Configuration Options

Workbox Configuration Restructuring

Three Workbox configuration options have been moved under a new config node. The old options still work but trigger deprecation warnings and will be removed in 2.0.0.

Old Option
New Option
Since

pwa.serviceworker.workbox.use_cdn

pwa.serviceworker.workbox.config.use_cdn

1.5.0

pwa.serviceworker.workbox.version

pwa.serviceworker.workbox.config.version

1.5.0

pwa.serviceworker.workbox.workbox_public_url

pwa.serviceworker.workbox.config.workbox_public_url

1.5.0

A new debug option has also been added under config:

New Features

Speeds up navigation requests by starting network requests in parallel with service worker boot-up.

circle-exclamation

See Navigation Preload for details.

Resource Hints

Automatically inject <link> tags for preconnect, dns-prefetch, and preload resources.

See Resource Hints for details.

Early Hints (HTTP 103)

Send HTTP 103 Early Hints responses for faster resource loading on supported servers (FrankenPHP, Caddy, etc.).

See Early Hints for details.

Speculation Rules

Configure the browser's Speculation Rules API for prefetching and prerendering pages.

See Speculation Rules for details.

Screenshot Generation with PHP Attribute

Generate screenshots automatically from your routes using the #[Screenshot] PHP attribute:

See Screenshots for details.

Mobile Web App Capable Meta Tag

The bundle now automatically injects the <meta name="mobile-web-app-capable" content="yes"> tag when the manifest display mode is set to standalone, fullscreen, or minimal-ui. This improves iOS compatibility.

Cache Strategy Listing Command

A new console command lists all registered cache strategies:

PreloadUrl Attribute

The #[PreloadUrl] attribute allows you to declare URLs that should be precached by the service worker:

See the PreloadUrl documentation for details.

Migration Checklist

Still Deprecated (from earlier versions)

The following options were deprecated in earlier versions and will also be removed in 2.0.0:

Option
Replacement
Since

pwa.favicons.src

pwa.favicons.default.src

1.3.0

pwa.favicons.src_dark

pwa.favicons.dark.src

1.3.0

pwa.favicons.background_color

pwa.favicons.default.background_color

1.3.0

pwa.favicons.background_color_dark

pwa.favicons.dark.background_color

1.3.0

pwa.favicons.border_radius

pwa.favicons.default.border_radius

1.3.0

pwa.favicons.image_scale

pwa.favicons.default.image_scale

1.3.0

pwa.path_type_reference

URL node path_type_reference parameter

1.1.0

Last updated

Was this helpful?