ziggrernVeta
New Member
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:\[code\] <script type="text/javascript" src="http://stackoverflow.com/questions/15572936/get_dates"></script>//returns the dates for each file in array <script type="text/javascript"> document.writeln('<script type="text/javascript" src="' + some_path + '?Mod=' + date_array[pos] + '"></script>...repeat for all scripts </script>\[/code\]The questions I have are:[*]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)[*]How will the caching of the html page affect this?[*]Does using document.writeln(() affect caching? I.e. will they still be cached if you write the same exact script?