Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion workers/dynamicFetch.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
function dynamicStrategy(event) {
event.waitUntil(
(async function () {
if (event.request.method !== 'GET') return
const url = new URL(event.request.url)
for (const matcher of self.context.worker.staleWhileRevalidate) {
if (match(matcher, url)) {
Expand All @@ -13,7 +14,6 @@ function dynamicStrategy(event) {
}
}
if (url.origin !== location.origin) return
if (event.request.method !== 'GET') return
if (url.pathname.indexOf('/nullstack/') > -1) {
return event.respondWith(networkFirst(event))
}
Expand Down
2 changes: 1 addition & 1 deletion workers/staticFetch.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
function staticStrategy(event) {
event.waitUntil(
(async function () {
if (event.request.method !== 'GET') return
const url = new URL(event.request.url)
for (const matcher of self.context.worker.staleWhileRevalidate) {
if (match(matcher, url)) {
Expand All @@ -13,7 +14,6 @@ function staticStrategy(event) {
}
}
if (url.origin !== location.origin) return
if (event.request.method !== 'GET') return
if (url.pathname.indexOf('/nullstack/') > -1) {
return event.respondWith(networkFirst(event))
}
Expand Down