fix(pwa): cache Amap tiles like the other raster presets

Without a Workbox rule for is.autonavi.com the offline pre-download
fetched the tiles and stored none of them, the hole #2180 closed for the
OpenStreetMap DE and Stadia presets.
This commit is contained in:
Maurice
2026-09-12 13:56:49 +02:00
parent fdb993de62
commit f120266f9e
+12
View File
@@ -126,6 +126,18 @@ export default defineConfig(({ mode }) => ({
cacheableResponse: { statuses: [0, 200] },
},
},
{
// Amap road and satellite presets, served from the shard hosts under
// is.autonavi.com (src/constants/mapDefaults.ts). Without a rule here
// they would be the #2180 hole all over again.
urlPattern: /^https:\/\/(?:[a-z0-9]+\.)?is\.autonavi\.com\/.*/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