fix(offline): cache osm-de and stadia tiles, prefetch down to the opening zoom (#2180)

This commit is contained in:
Maurice
2026-09-01 17:45:08 +02:00
committed by Maurice
parent 1e6f1fe95c
commit 5decdcfa13
5 changed files with 78 additions and 6 deletions
+22
View File
@@ -92,6 +92,28 @@ export default defineConfig(({ mode }) => ({
cacheableResponse: { statuses: [0, 200] },
},
},
{
// OpenStreetMap DE — a shipped preset that matched no rule at all, so
// "Store map tiles offline" fetched thousands of tiles and stored none
// of them (#2180). Same cache, same limits as the rules above.
urlPattern: /^https:\/\/tile\.openstreetmap\.de\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'map-tiles',
expiration: { maxEntries: 12288, maxAgeSeconds: 30 * 24 * 60 * 60 },
cacheableResponse: { statuses: [0, 200] },
},
},
{
// Stadia Smooth — the other shipped raster preset with the same hole (#2180).
urlPattern: /^https:\/\/tiles\.stadiamaps\.com\/tiles\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'map-tiles',
expiration: { maxEntries: 12288, maxAgeSeconds: 30 * 24 * 60 * 60 },
cacheableResponse: { statuses: [0, 200] },
},
},
{
// The GL style DOCUMENT, for both providers. It has to be matched
// before the tile rules below, because Workbox takes the first route