Website Cache is Saved and that's why it don't show the updated website to the users

I have changed style or css file in my website . Everything is perfect But since the browser Cache is Saved so in normal browser , the change is not showing . It shows the previous website . But when I browse in Private window or incognito window or clear Cache then it shows the updated website .

Now my question is , my website’s users don’t use Private window or incognito window or they may be don’t clear Cache. So how can I solve this issue so that , my all users can see the updated website in their browser .
This is not the Wordpress website . This website is created by using PHP + HTML + CSS + JS .

Thanks in advance .

You need to look at cache busting. The most straightforward approach is to ensure your website is setting the correct cache control headers.

Further info from Stack Overflow:

Look into the cache-control and the expires META Tag.

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2002 11:12:01 GMT">

Another common practices is to append constantly-changing strings to the end of the requested files. For instance: ( If you alter one JS code file, even if blank, the browser forces a reload of the cached data. )

<script type="text/javascript" src="main.js?v=12392823"></script>

1 Like
Sponsor our Newsletter | Privacy Policy | Terms of Service