sw: never look in cache for query to a different domain
This commit is contained in:
parent
fc36423b57
commit
759a1a96b3
|
@ -53,13 +53,17 @@ self.addEventListener('fetch', function(event) {
|
|||
pathname = url.pathname,
|
||||
is_preview = url.searchParams.get("preview");
|
||||
|
||||
/* If different domain, then response is not cached */
|
||||
if (window.location.hostname !== url.hostname) {
|
||||
return event.respondWith(fetch(event.request));
|
||||
}
|
||||
|
||||
if (event.request.referrer) {
|
||||
var referrer_url = new URL(orig_request.referrer),
|
||||
is_preview = is_preview || referrer_url.searchParams.get("preview");
|
||||
}
|
||||
|
||||
if (pathname.endsWith("/edit")) {
|
||||
console.log('Nicolas: ', pathname);
|
||||
let offset_length = "/edit".length,
|
||||
real_pathname = pathname.substring(0, pathname.length - offset_length);
|
||||
|
||||
|
|
Loading…
Reference in New Issue