I have an application running on hostgator. When I make changes to the js files my users don\'t see the changes until they clear their cache. Is this the only option to pu
A simple trick I use sometimes is to add some dummy parameters to the path of the JavaScript/CSS file. The browser will essentially see a different URL and will not use it's cached version.
$jsFile = '/js/myFile.js'; // probably cached
$jsFile = '/js/myFile.js?r='.time(); // won't ever be cached
You can't really clear the clients cache, but you can trick the clients browser into thinking that this is the first time it is seeing this file and it will download it again.
Don't forget to disable this once you have arrived at a stable version. Caching files is a great way to speed up an application's load time.