Skip to content

Commit

Permalink
feat: sw cache osm tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
muktihari committed Dec 1, 2023
1 parent 55270e1 commit 3911849
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@ export default defineConfig({
workbox: {
runtimeCaching: [
{
urlPattern: new RegExp('/assets/.*\\.ttf'),
urlPattern: new RegExp('/assets/.*\\.(svg|ttf|woff2)$'), // cache assets that don't automatically included.
handler: 'CacheFirst'
},
{
urlPattern: new RegExp('/assets/.*\\.woff2'),
handler: 'CacheFirst'
},
{
urlPattern: new RegExp('/assets/.*\\.svg'),
urlPattern: new RegExp('^https://.*\\.openstreetmap.org/.*\\.png$'), // cache osm tiles.
handler: 'CacheFirst'
}
]
Expand Down

0 comments on commit 3911849

Please sign in to comment.