Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome keeps loading a old cache of my website

I am experiencing this weird issue where my Chrome browser keeps loading a old version of my website whose code doesn't even exist on my server any more. I assume it's a typical cache issue.

I tried to clean the browser cache, use igcognito mode, and clean DNS cache. The old cached page is still being loaded.

This issue seems to have been discussing on this google group for three years but there is still no solutions. https://productforums.google.com/forum/#!topic/chrome/xR-6YAkcASQ

Using firefox or any other web browsers works perfectly.

It doesn't just happen to me. All my coworkers experience the same issue on my website.

like image 672
zeroliu Avatar asked Sep 30 '14 01:09

zeroliu


People also ask

How do I force Chrome to load a fresh copy of a page?

To hard refresh on Google Chrome on Windows, there are two ways you can do it: Hold down Ctrl and click the Reload button. Or Hold down Ctrl and press F5.

Why am I getting an old version of a website?

If when visiting your site's domain in your browser, you are still seeing your old website come up (even hours after the correct DNS settings were entered), it may be that your computer or network is still using the old (cached) DNS information for your site.


1 Answers

<?php Header("Cache-Control: max-age=3000, must-revalidate"); ?> 

You can implement a PHP script that must be the first line of code in your index file . It is an http header typically issued by web servers. You can also rename the resource that is considered "stale". This tutorial will give you more details. https://www.mnot.net/cache_docs/

like image 178
Eli Duhon Avatar answered Oct 18 '22 06:10

Eli Duhon