How to tell if javascript is getting reloaded in cache
<p>I was facing the issue of javascript being cached on users' browsers and not getting updated when changes went to production.  Because the site uses multiple embedded iframes, just using f5 wasn't sufficient.  The solution I went with is to load a script first that gets all the modified dates for the js files I need and then appends those dates to the js file in each page. Each page looks something like this:</p>

<pre><code>    &lt;script type="text/javascript" src="get_dates"&gt;&lt;/script&gt;//returns the dates for each file in array
    &lt;script type="text/javascript"&gt;
        document.writeln('&lt;script type="text/javascript" src="' + some_path + '?Mod=' + date_array[pos] + '"&gt;&lt;/script&gt;...repeat for all scripts
    &lt;/script&gt;
</code></pre>

<p>The questions I have are:</p>

<ol>
<li>How do you tell if the scripts are getting cached until the mod date changes? (I still want them to be cached, just not if they're updated)</li>
<li>How will the caching of the html page affect this?</li>
<li>Does using document.writeln(() affect caching? I.e. will they still be cached if you write the same exact script?</li>
</ol>
