Slide 33
Slide 33 text
Event: onInstall
● Download contents depends on
deploy version
function onInstall(event) {
event.waitUntil(
caches.open(CACHE_NAME).then(function prefill(cache) {
return cache.addAll([
'<%= asset_path "base.js" %>',
'<%= asset_path "minimal.css" %>',
'/offline.html',
'<%= asset_path "devword.png" %>',
'<%= asset_path "wires.png" %>',
'<%= asset_path "comments-bubble.png" %>',
'<%= asset_path "reactions-stack.png" %>',
'<%= asset_path "readinglist-button.png" %>',
'<%= asset_path "emoji/emoji-one-heart.png" %>',
'<%= asset_path "emoji/emoji-one-unicorn.png" %>',
'<%= asset_path "emoji/emoji-one-bookmark.png" %>',
'<%= asset_path "emoji/apple-fire.png" %>',
]).then(function () {
console.log("WORKER: Install completed");
});
})
);
}