Fix persistent caching: no-store/no-cache headers, SW v4, versioned asset URLs
This commit is contained in:
1 parent
86914a7329
commit
ea20d31217
3 files changed
+15
-5
No files matched your search
@@ -16,7 +16,7 @@
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Playfair+Display:wght@500;600&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<link rel="stylesheet" href="style.css?v=4">
|
||||
</head>
|
||||
<body>
|
||||
<div class="app">
|
||||
@@ -301,7 +301,7 @@
|
||||
</div><!-- .app -->
|
||||
|
||||
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
||||
<script src="app.js"></script>
|
||||
<script src="app.js?v=4"></script>
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
const CACHE = 'weather-v3';
|
||||
const CACHE = 'weather-v4';
|
||||
|
||||
// App shell — cached on install for offline use
|
||||
const PRECACHE = [
|
||||
'/',
|
||||
'/app.js',
|
||||
'/style.css',
|
||||
'/app.js?v=4',
|
||||
'/style.css?v=4',
|
||||
'/manifest.json',
|
||||
'/icons/icon.svg'
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user