Skip to content

Commit

Permalink
ServiceWorker changes for auto update and edit event announcement.
Browse files Browse the repository at this point in the history
  • Loading branch information
dwvisser committed Jan 30, 2019
1 parent 680a39a commit 763f361
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 41 deletions.
26 changes: 0 additions & 26 deletions flyers/2019-Feb-Forum.html

Large diffs are not rendered by default.

14 changes: 3 additions & 11 deletions index.html
Expand Up @@ -94,23 +94,15 @@ <h1>Greater Knoxville</h1>
<div class="col-md-12">
<div class="alert alert-info alert-dismissible fade show" role=alert>
<p>Come to our Climate Change Action Forum on Saturday, February 9th at 10 AM!
<a href="https://catwknoxvilletn.eventbrite.com/">Register here</a> to attend.</p>
<a href="https://catwknoxvilletn.eventbrite.com/">Register here</a> or e-mail
Chet Hunt at <a href="mailto:chunt51@comcast.net">chunt51@comcast.net</a> to attend.</p>
<div id=2019-feb-forum></div>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="alert alert-info alert-dismissible fade show" role=alert>
<div id=2019-feb-forum></div>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
</div>
</div>
</div> <!-- Announcements -->

<div id="main-container" class="container">
Expand Down
9 changes: 6 additions & 3 deletions service-worker.js
Expand Up @@ -13,6 +13,9 @@

importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");

workbox.skipWaiting();
workbox.clientsClaim();

/**
* The workboxSW.precacheAndRoute() method efficiently caches and responds to
* requests for URLs in the manifest.
Expand All @@ -29,11 +32,11 @@ self.__precacheManifest = [
},
{
"url": "flyers/2019-Feb-Forum.html",
"revision": "66ce66d067fd11f40ba364ffc41821c6"
"revision": "1a686b54505bfd3ee3c9fc668deb4ae1"
},
{
"url": "index.html",
"revision": "3551b33ef30eae00a9fb3453d6908dd9"
"revision": "7361f157253c6169fa939d70aa0ce799"
},
{
"url": "manifest.json",
Expand Down Expand Up @@ -81,7 +84,7 @@ self.__precacheManifest = [
},
{
"url": "workbox-config.js",
"revision": "1cf61e42906b92b4b4dd9d9554de7e3b"
"revision": "1148939bbcb945dae2bc4f1c856d5fa3"
}
].concat(self.__precacheManifest || []);
workbox.precaching.suppressWarnings();
Expand Down
9 changes: 8 additions & 1 deletion workbox-config.js
Expand Up @@ -22,5 +22,12 @@ module.exports = {
maxEntries: 100,
},
},
}]
}],
// See https://developers.google.com/web/tools/workbox/modules/workbox-build#full_generatesw_config
// The following 2 options force kicking out the old ServiceWorker and activating the
// new one on all client tabs as soon as the new ServiceWorker is installed. It is an
// anti-pattern for PWAs in general (see https://redfin.engineering/how-to-fix-the-refresh-button-when-using-service-workers-a8e27af6df68),
// but for this simple "static" site I would rather users always see the latest content.
skipWaiting: true,
clientsClaim: true
};

0 comments on commit 763f361

Please sign in to comment.