Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

206
Views
How is a progressive web app updated - is the install even re-triggered?

In this answer When and how does a PWA update itself? it is explained that a PWA is updated if manifest.json links are updated or if one character is modified from the service-worker.js file.

But what do we exactly mean by "updated"? Does this mean the install event is re-triggered and that all the listed files below are re-downloaded?

Is there a documentation confirming this is the case for all browsers on Android and iOS? (I don't know if the latter uses PWA the same way than on Android)

Here is an example service-worker.js file:

self.addEventListener('install', (e) => {
  e.waitUntil(
    caches.open('myapp-store').then((cache) => cache.addAll([
      '/app/index.html',
      '/app/file1.jpg',   
      '/app/file2.mp3',   
      '/app/file3.png',   
    ])),
  );
});

self.addEventListener('fetch', (e) => {
  console.log(e.request.url);
  e.respondWith(
    caches.match(e.request).then((response) => response || fetch(e.request)),
  );
});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The service worker update flow is independent from any update checks that apply to the web app manifest.

"The Service Worker Lifecycle" is recommended reading, and it explains the complain initial install and update flow.

To borrow from that document and answer your question, yes, the install event of the updated service worker file will be executed once a browser detects that update. If your updated service worker file includes a cache.addAll() then that will be executed, and if the URLs being cached are identical to the same URLs previously cached, and the cache name is the same, then the old cached values will be overwritten with whatever is fetche during install.

Many folks include inline versioning information in their service worker file so that they can trigger an update by changing that value. They also might use a new cache name tied to that versioning information, so that instead of overwriting previously cached values, new cache entries will be created. This tends to be safer, since the old service worker will remain in control of open pages until the updated service worker activates, and using versioned cache names means that the old service worker can continue reading the cached values it expects.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!