How to solve problem with javascript files served from cache?
<p>When server side code is updated (related to JavaScript) the old JavaScript files are served from cache.</p>

<p>I need a solution where the old JavaScript files get updated to their newer versions. Browser cache (related to JavaScript) need to be invalidated once the files on server are updated.</p>

<p>I have got the following solution to this problem.</p>

<pre><code>var randomnumber=Math.floor(Math.random()*10000);

var scriptfile='http://www.whatever.com/myjs.js?rnd='+randnumber;
</code></pre>

<p>But I need to clear cache only when there is some update on the JavaScript files not on every reload of the page.</p>
