Website not updated after changing repo if user visited website before

Hi everyone

I have changed my repo for victoryap.com.

However, I believe that is something wrong with the caching issues.

If the person has visited my website before, he will not be able to view my new website.
He will still see the old website without the images.

If the person has not visited my website or visit my website via incognito mode, he will be able to view my new website.

I have tried various method such as removing the site, removing the original repo for the site but to no avail.

May I know how to resolve this issue?
Thank you

Regards,
Victor

It seems like the DNS setting is not updated after changing repo.

  • This is a system record that cannot be managed directly.

DNS changes are not needed to publish changes in your site.

I suspect this is related to service workers: https://www.netlify.com/blog/2018/09/21/international-service-worker-caching-awareness-day/ . Is your site using one? Does unregistering it (and removing or correcting its config in your site building tool) help?

hey man, thank you for your help. It is service worker related issue.

It works after i unregistered the service worker

May I know how to remove this service worker for client side too?
I tried removing the domain and adding it back but service worker is still there.

Thank you

It seems that the service worker is cached somewhere in netlify. I have called the function to unregister the service worker. Unless the user revisit my old website(With the function to unregister the service worker) before visiting my new website. The service worker still remains there.

The old website is created using reactjs
The new website is created using angular.

All files are cached somewhere within netlify :slight_smile: Service workers are also cached in the browser, and the article I linked you to talks about how to prevent that.

To unregister on the client side, you’d need to do something like is mentioned in this article:

changing your stack on netlify will have no effect on what is ALREADY cached in client browsers, so you’ll have to take some steps to fix it.

Yes, i totally agree that changing my stack wont have no effect on what is already cached in client browsers. I wish that it will have an effect :rofl:

What I am trying to say is. Unless the user visit my old reactjs website (With the function to unregister the service worker), the service worker will still remain if they visit new angularjs website directly.

I tried various methods to detect the service worker and unregister the service worker on my new angularjs website (including the one you have shown me) but to no avail. I suspect that the reactjs service worker is preventing the client site from fetching my angularjs files.

I have tried removing the domain name and adding back the domain name, deleting the old repo… etc, hoping that my site will start a fresh start.

Anyway, thank you so much for your help. I will just live with the bug since I am a nobody and not much people have visited my old website anyway.:joy:

I think your suspicion is right - the thing you have to do is get people to visit a NEW webpage, not cached, that runs the deregistration script. That can be pretty hard to do if you had a small site and your misconfigured service worker cached all of it so there is no reason for people to “wander” to new URL’s…

1 Like