mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
fix(offline): cache osm-de and stadia tiles, prefetch down to the opening zoom (#2180)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user