I’m having an issue with deployment of my static website deployed on GitHub. It looks like when I google for my website, it shows my old website, but it should show my new added website. My Netlify site name is https://aneta.netlify.app/ I don’t have custom domain.
In the past, I was using the same URL with an old website, but I have deleted the old website in my dashboard. Then, I have added my new site, and edited default URL and changed it to my old URL website.
Note: I found this issue, when testing on external devices. On my computer, google display the website I have added (the right one!), but on my friend’s smartphone it shows the old website.
When you say Google is displaying the correct site, you mean in the search results it displays text from the old site, or do you mean Google Chrome?
If different devices are displaying different content (or different browsers on the same device), it is highly possibly the old content is cached on the device. Clearing the device/browser cache, hard refreshing, etc. should help remedy this.
It would also help if you could provide screenshots of the content you should see versus the content you are seeing. (For what it is worth, I see the same content on desktop and mobile.)
Failing this, a request ID for content that is incorrect will help Netlify determine if there is any possibility of a cache issue on the CDN.
I’ll ask my friend to clean the caches. The new site is from a few months ago. Does it mean that the surfers online will always see old content, if they won’t clean their caches?
This is the information, I found in the Response tab via devtools. As far I can see is Gatsby, webpack etc…things from my old website, I have deleted months ago. Can you find here something what might resolve the issue?
This is the right page. Do you clean the cache by yourself, or is it something the internet do it for you? For example, this is my portfolio and I don’t know which recruiter has cleaned her cache Is there a solution to make sure that my website sends the right data to the visitor?
Without asking people individually, there is no way to know what content they are seeing. Given the default cache control set by Netlify, there is little chance old content is served.
Did the old site use a service worker? If so, this may cause issues. Check out
Thank you so much for the solution. The service worker on this computer was turned on. Is there a way to unregister service workers for every computer? We removed our framework and now use only vanilla code. So my new site does not use service workers for months already, because
Not having ever had the need to use a service worker (and thus not needing to unregister one) my only suggestion is to add the script snippet in the aforementioned guide to your site and to read the link to Stack Overflow in the reply post on said guide.
Again, I can only speculate. Others with more experience with service workers may provide other/better advice/solutions.
Thanks for the tip. I tried these things already, but yesterday we found a new computer with the same issue.
My new website does not use service workers or any packages, webpacks etc. For some reason Netlify gives this as the output to the browser on some computers. This website is completly different, I removed to the old website. Is it possible to remove it from your bin database?
The problem is not with the new website, but with the old one - if I recall, a lot of Gatsby templates using a plugin called gatsby-plugin-offline which would automatically install a service worker. Now anyone who had visited your old site in the past - would have that service worker installed and thus, won’t be able to load the new site.
The only solution in this case would be to use a different domain name. If you ask your users to load: https://6310773bca31fc0009c44040--aneta.netlify.app/, does it load fine? If yes, Netlify is serving the correct content, and my above assertion is true.