marsxtc
December 21, 2020, 9:13pm
1
Hi! I recently switched my Github deployment over to a different repo, however, after deploying the new website it seems to still show the old version of the website on my browser.
If I go into Incognito mode it shows the new version, so I tried clearing my cache etc but nothing works.
my website is stanlee.codes
Edit:
I ended up deleting the site all together, and deployed a new site using the same custom domain name.
It’s still showing the cached version of the website on my devices
I was trying the suggestions from
so, the content still exists on the cdn nodes - you deploy to origin, and then it gets pushed out to the edge. so that’s actually not surprising. It won’t get deleted unless you delete the netlify site.
Is the .wtf site the correct site, now? This is what i see:
[image]
if yes:
I would suggest you delete the netlify site that feeds into marguerite.io through our dashboard, and create a new site, deploy the same code that is on wtf (if that, indeed, is the correct one) and then re-associate…
This seems like a service worker problem. If you share the correct link of the website or the repo, someone can confirm.
marsxtc
December 24, 2020, 9:54pm
3
This is the correct link of my current website.
I’ve had to clear my cache on devious through dev tools → application → cache → cache storage and delete it.
Other users who have visited the previous version of my website are still seeing the previous version, not the new one.
Yes. That’s what happens due to service workers. You’d have to add logic to the service worker to delete the old cache when new one is available.
marsxtc
December 25, 2020, 8:57am
5
Do you have any suggestions on how I would proceed with doing this? I’ve added a separate CSS file and started changing the versions but beyond that I have no clue how to work with the service workers
Try unregistering the service worker.
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js').then(function(registration) {
// registration worked
console.log('Registration succeeded.');
registration.unregister().then(function(boolean) {
// if boolean = true, unregister is successful
});
}).catch(function(error) {
// registration failed
console.log('Registration failed with ' + error);
});
};
Note, change the service worker path with your own.
perry
December 28, 2020, 7:09pm
7
hi there, this might also be helpful:
Last reviewed by Netlify Support - August, 2023
A service worker is a script that your browser runs in the background to accomplish a variety of tasks. Browsers cache service workers for 24 hours by default, and don’t update them when you reload your page. Therefore, you may have a service worker on your site which could prevent you from seeing the latest and greatest changes that you’ve made.
If you suspect a service worker is causing this issue, I recommend disabling/removing the service wor…