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

View file

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