phido Report post Posted March 14, 2011 (edited) Hello. I recently noticed my charts were being cached in IE explorer. As a result, visitors see the charts on their initial visit, but not on subsequent visits. The chart on are rendered on a PHP page as follows ... <div id="chartdiv" align="center">FusionCharts. </div> <script type="text/javascript"> var chart = new FusionCharts("../charts/Line.swf", "ChartId", "750", "310", "0", "0"); chart.setDataURL("data/99_001.xml"); chart.render("chartdiv"); </script> How do I prevent IE from applying its cache so charts are rendedered on subsequent visits? Thak you. Edited March 14, 2011 by phido Share this post Link to post Share on other sites
FusionCharts Support Report post Posted March 14, 2011 Hi, Thanks for your mail. Could you please pass us the code in PHP that you are using to render the chart? Also could you please let us know, whether in subsequent visits you see the same chart or no chart at all. In case you wish to see a chart with expected change of data you would need to set cache killing query string along with the XML URL. e.g., in PHP: "data/99_001.xml?nocache=" . microtime() Share this post Link to post Share on other sites
phido Report post Posted March 14, 2011 Thank you for the very fast reply. To clarify ... The page itself is a PHP page, but php is only applied to produce some content that is unrelated to FusionCharts. The charts are produced (fairly generically I'm presuming) as follows. <head> <script language="javaScript" src="../jsclass/FusionCharts.js"></script> </head> <body> <div id="chartdiv" align="center">FusionCharts. </div> <script type="text/javascript"> var chart = new FusionCharts("../charts/Line.swf", "ChartId", "750", "310", "0", "0"); chart.setDataURL("data/99_001.xml"); chart.render("chartdiv"); </script> <div id="chartdiv2" align="center">FusionCharts. </div> <script type="text/javascript"> var chart = new FusionCharts("../charts/Line.swf", "ChartId", "750", "310", "0", "0"); chart.setDataURL("data/99_001a.xml"); chart.render("chartdiv2"); </script> </body> The charts are generally accessed via a UI on another page. A visitor with an empty cache will see the charts as expected. However, it seems that as long as the cache is not cleared (of the specific page's content) the visitor is presented with the FusionCharts placeholder when visiting the page. Once the cache is cleared the cycle repeats; i.e., upon visiting the page the chart is rendered as expected ... then until the cache is cleared the user sees the Fusioncharts placeholder. This only seems to be happening in IE9. If IE9 settings are set to 'Check for newer versions of stored pages ... every time I visit the webpage' the FusionCharts content renders normally. For the sake of speed, this is not IE9's default setting; at least it wasn't on my installation. It is set to: 'Check for newer versions of stored pages ... automatically.' I doubt users will bother to change this. Two images are attached (1) emptycacheview.png, and (2) fullcacheview.png. Thanks again for the assistance. Share this post Link to post Share on other sites
phido Report post Posted March 14, 2011 Attempted to implement the following ... <div id="chartdiv" align="center">FusionCharts. </div> <script type="text/javascript"> var chart = new FusionCharts("../charts/Line.swf", "ChartId", "750", "310", "0", "0"); <?php $micro = microtime(); echo 'chart.setDataURL("data/99_001.xml?nocache= . $micro");'; ?> chart.render("chartdiv"); </script> .. but results are the same. Any thoughts? Share this post Link to post Share on other sites
FusionCharts Support Report post Posted March 15, 2011 seems you need to do the same cache killing for the swf path. but not in php.you need to use javascript. Share this post Link to post Share on other sites
FusionCharts Support Report post Posted March 15, 2011 some thing like: 'line.swf?nocache=' + new Date().valueOf(); Share this post Link to post Share on other sites