How to force the user's browser to clear its cache

I made some changes to my website and people were not seeing the change. Then the thought came that they need to clear their cache. I helped a few people do that and it solved the problem. But how can I force a browser to clear its cache when it visits my website? I have thousands of users.

Thanks.

You can’t force a user to do do this. But you can try to prevent the user’s browser from caching the page in the first place. For example, you can use meta elements like so:

<meta http-equiv="Expires" content="Mon, 26 Jul 1997 05:00:00 GMT">
<meta http-equiv="Pragma" content="no-cache">

But that’s not totally reliable (the user’s ISP might cache the page anyway), and perhaps out of date. Another, perhaps more robust option, is to use HTTP headers, as explained here:

Is it javascript that’s being cached?

If so, you can add a version number to the name of the javascript files in question, and this will force the browser to redownload them. Eg: site_script.js becomes site_script_v1.0.js

Good point. You could do that with CSS too.