* dev-12140843

* dev-12140844

* Update sw.js

* Update not_found.html

* Update sw.js
This commit is contained in:
Victor Westerlund 2020-12-14 09:00:04 +01:00 committed by GitHub
parent c6e4eab25f
commit 4a181e15e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 11 deletions

View file

@ -5,8 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Full-stack web developer from Stockholm, Sweden.">
<meta name="theme-color" content="#ffffff">
<link href="assets/img/favicon.png" rel="icon">
<link href="assets/css/style.css" rel="stylesheet">
<link href="/assets/img/favicon.png" rel="icon">
<link href="/assets/css/style.css" rel="stylesheet">
<title>Page Not Found - Victor Westerlund</title>
<style>
#content {
@ -63,9 +63,9 @@
<h2>idk..</h2>
</div>
<picture>
<source srcset="assets/img/where.webp" type="image/webp">
<source srcset="assets/img/where.gif" type="image/gif">
<img srcset="assets/img/where.png" type="image/png"/>
<source srcset="/assets/img/where.webp" type="image/webp">
<source srcset="/assets/img/where.gif" type="image/gif">
<img srcset="/assets/img/where.png" type="image/png"/>
</picture>
</body>
</html>

View file

@ -1,4 +1,4 @@
const version = "12140809";
const version = "12140858";
const root = "/";
let activeCaches = [
@ -62,11 +62,7 @@ self.addEventListener("fetch", event => {
// Get pattern.gif from generator. Fallback to cache on failure
if(origin && url.pathname.endsWith("pattern.gif")) {
const pattern = new Request(`${location.origin}${root}assets/img/pattern.php`);
event.respondWith(
fetch(pattern).catch(() => {
return caches.match(event.request);
})
);
event.respondWith(fetch(pattern).catch(() => caches.match(root + "assets/img/pattern.gif")));
return;
}