Skip to content

Commit

Permalink
chore: add some more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
JalilArfaoui committed Jan 16, 2025
1 parent 369ecbb commit 96eaaba
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions site/source/entries/entry-sw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ offlineFallback({
: '/infrance.html',
})

registerRoute(
({ url }) => {
console.log('Checking route for:', url.href)

return false // Your actual matching logic here
}
// your strategy
)

// Set the default handler with network first so that every requests (css, js, html, image, etc.)
// goes through the service worker and will be cache
setDefaultHandler(
Expand All @@ -55,6 +64,13 @@ setDefaultHandler(
maxAgeSeconds: 3 * MONTH,
maxEntries: 40,
}),
{
requestWillFetch: async ({ request }) => {

Check failure on line 68 in site/source/entries/entry-sw.ts

View workflow job for this annotation

GitHub Actions / lint

Async method 'requestWillFetch' has no 'await' expression
console.log('Handler SW par défaut pour :', request.url)

return request
},
},
],
})
)
Expand Down

0 comments on commit 96eaaba

Please sign in to comment.