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

154
Views
Invalidate Angular service worker / force update server side

Is there any way to force users to reload my web application and get around local service worker, maybe via some configuration on my webserver (nginx) or any other means?

Background: I have a bit of a problem: I have an angular application with service worker, that is already cached on peoples machines. The code below shows, how it checkes for updades, displays and update message and then does the update, once the update message is dismissed. Unfortunately there is Bug in the update message (snackbarService.showVersionUpdate()) that updates.activateUpdate() is never called. So the old, cached frontend version is used until the browser window is closed and reopened or reloaded with Ctrl+F5.

The problem is, all fixes to the code only come into effect after an update of the service worker, which itself is the problem.

constructor(updates: SwUpdate, snackbarService: SnackbarService) {
    updates.checkForUpdate();
    updates.available.subscribe(event => {
        // Show snackbar
        const snackBar = snackbarService.showVersionUpdate();
        snackBar.afterDismissed().subscribe(() => {
            updates.activateUpdate().then(() => {
                window.location.reload();
            });
        });
    });
}

I am grateful for any solutions or ideas!

Edit: I found this answer, which talks about updating the service worker itself. Does anyone know how to do that with the angular service worker?

about 4 years ago · Juan Pablo Isaza
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!