use versioning for service worker and web app manifest

This commit is contained in:
Daniel Friesel 2019-05-03 21:02:24 +02:00
parent 5178e58c0c
commit cdbb3ee45b
4 changed files with 16 additions and 16 deletions

View file

@ -1,12 +1,12 @@
const CACHE_NAME = 'static-cache-v10';
const CACHE_NAME = 'static-cache-v11';
const FILES_TO_CACHE = [
'/offline.html',
'/static/v10/css/materialize.min.css',
'/static/v10/css/material-icons.css',
'/static/v10/css/local.css',
'/static/v10/js/jquery-2.2.4.min.js',
'/static/v10/js/materialize.min.js',
'/static/v10/js/travelynx-actions.min.js',
'/static/v11/css/materialize.min.css',
'/static/v11/css/material-icons.css',
'/static/v11/css/local.css',
'/static/v11/js/jquery-2.2.4.min.js',
'/static/v11/js/materialize.min.js',
'/static/v11/js/travelynx-actions.min.js',
];
self.addEventListener('install', (evt) => {

View file

@ -3,27 +3,27 @@
"short_name": "travelynx",
"scope": "/",
"icons": [{
"src": "/static/icons/icon-128x128.png",
"src": "/static/v11/icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png"
}, {
"src": "/static/icons/icon-144x144.png",
"src": "/static/v11/icons/icon-144x144.png",
"sizes": "144x144",
"type": "image/png"
}, {
"src": "/static/icons/icon-152x152.png",
"src": "/static/v11/icons/icon-152x152.png",
"sizes": "152x152",
"type": "image/png"
}, {
"src": "/static/icons/icon-192x192.png",
"src": "/static/v11/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
}, {
"src": "/static/icons/icon-256x256.png",
"src": "/static/v11/icons/icon-256x256.png",
"sizes": "256x256",
"type": "image/png"
}, {
"src": "/static/icons/icon-512x512.png",
"src": "/static/v11/icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}],

View file

@ -8,9 +8,9 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Weather PWA">
<link rel="apple-touch-icon" href="/static/icons/icon-152x152.png">
<link rel="manifest" href="/static/manifest.json">
% my $av = 'v10'; # asset version
% my $av = 'v11'; # asset version
<link rel="apple-touch-icon" href="/static/<%= $av %>/icons/icon-152x152.png">
<link rel="manifest" href="/static/<%= $av %>/manifest.json">
%= stylesheet "/static/${av}/css/materialize.min.css"
%= stylesheet "/static/${av}/css/material-icons.css"
%= stylesheet "/static/${av}/css/local.css"