Added Service Worker to Cache Assets for Offline

Added a service worker script to cache assets on local storage. In testing on desktop it worked. Need to test further on mobile.
This commit is contained in:
2018-11-12 12:44:30 -05:00
parent ff965e94d5
commit c16e2f763d
4 changed files with 320 additions and 24 deletions

15
sw.js
View File

@@ -1,10 +1,17 @@
const filesToCache = [
'/',
'style/main.css',
'images/still_life_medium.jpg',
'css/appstyling-v2.css',
'css/main.css',
'js/Weight Calculation Script-Edited-Jquery-V4.js',
'images/45lbs-Plate.svg',
'images/35lbs-Plate.svg',
'images/25lbs-Plate.svg',
'images/10lbs-Plate.svg',
'images/5lbs-Plate.svg',
'images/2halflbs-Plate.svg',
'images/favicon-16x16.png',
'images/favicon-32x32.png',
'index.html',
'pages/offline.html',
'pages/404.html'
];
const staticCacheName = 'pages-cache-v1';