The image below shows that there are two workers installed - one active and the other not active (just installed).
service-worker.js
and reload the page.So a new service worker is spawned with a new version ID. But why does the old one keeps running ? and How do I close it ?
The sw.js
is here https://gist.github.com/boopathi/57b7e8b6d657d55bdc7d
One of the most common excuses used to get rid of older employees is “job elimination.” However, that may just be an excuse for what is really age discrimination. If the company is not really eliminating the job, just changing the title and putting someone younger is your former position, you may have an age discrimination claim.
One of the most common excuses used to get rid of older workers is “job elimination.” Photo: Getty ... [+] Older workers are still suffering in the aftermath of the Great Recession. More than half the people aged 50 and older who participated in a recent AARP survey said they had either experienced or witnessed age discrimination in the workplace.
The U.S. has improved substantially in its treatment of older workers since the Age Discrimination in Employment Act was passed in 1967. Take a look at how employers are developing or enhancing programs to recruit and retain older workers. ProPublica and Urban Institute Studylexibility, Fairness, Trust, Empowerment Make Work Human
Data analysis by ProPublica and the Urban Institute shows that more than half of older U.S. workers are pushed out of longtime jobs before they choose to retire. AgeOrganization and Employee DevelopmentOrganizational Exit
By default, until all tabs that have a page controlled by that old service worker are closed/unloaded, the old service worker will stay running. The new service worker will, well, "wait" in the "waiting" state.
There are options that change this default behavior. They're skipWaiting()
and clients.claim()
.
When skipWaiting()
is called from an installing service worker, it will, well, skip the "waiting" state and immediately activate. However, it will not necessarily take control of pages despite being activated—that's what clients.claim()
will accomplish.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With