[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1139
  • Last Modified:

FusionCharts Caching

Hi Experts,

I am developing a series of near real-time charts using FusionCharts v3 and Coldfusion 8.  I am having trouble with each browser caching the chart, even through the XML has changed.  I am looking for a solution to force each web browser (IE7, IE8, Firefox, Safari, etc...) to display the chart using the new XML file each time the browser is refreshed.

I have attached the code that I am using to display chart.  I am not have trouble displaying the chart itself. I have tried to use the following two examples without any success.

param name="FlashVars" value="&dataURL=chartxml/data2.xml&nocache="+ new Date().valueOf())&chartWidth=900&chartHeight=300

param name="FlashVars" value="&dataURL=chartxml/data2.xml&dataURL=chartxml/data2.xml? + math.random())&chartWidth=900&chartHeight=300

Thank you,

Eric

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="250" height="250" id="Column3D" >
<param name="movie" value="FusionCharts/AngularGauge.swf" />
<param name="FlashVars" value="&dataURL=chartxml/data2.xml&chartWidth=900&chartHeight=300>
<param name="quality" value="high" />
<embed src="FusionCharts/AngularGauge.swf" flashVars="&dataURL=chartxml/data2.xml&chartWidth=250&chartHeight=250" quality="high" width="250" height="250" name="Column3D" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

Open in new window

0
ehart12
Asked:
ehart12
  • 2
  • 2
1 Solution
 
duncancummingCommented:
you're missing a closing " on the end of your FlashVars param, but I assume that's just a copy-and-paste error, and that's not your actual code?

When you say you've had no success, you mean those two examples you give don't stop the  caching, or do you get errors, or what?
0
 
ehart12Author Commented:
Hi duncancumming,

Thank you very much for the reply!  The two above attempts do not stop the caching.  The page loads and the charts are displayed without any errors, however the chart is incorrect since the XML file has changed.  Also, the missing " as the end of the param is a cut-paste error...

Thanks again,

Eric
0
 
duncancummingCommented:
You are putting your random parameters on the <param> tag, but did you also put it on the <embed> tag at the same time?

I'm wondering if this
param name="FlashVars" value="&dataURL=chartxml/data2.xml&dataURL=chartxml/data2.xml? + math.random())&chartWidth=900&chartHeight=300

should just be:
param name="FlashVars" value="&dataURL=chartxml/data2.xml? + math.random()&chartWidth=900&chartHeight=300

i.e. you are repeating dataURL in the above example; also note you seem to have an extra ) after .random

I've not done anything with FusionCharts, but I assume you have access to CFML at this point?  If so I'd perhaps use a CF function instead, like dataURL=chartxml/data2.xml?#GetTickCount()#

However you may need to wrap the dataURL param in quotes or something, otherwise I can't see how it knows where your params to dataURL end and your params to FlashVars begins!

e.g.
param name="FlashVars" value="&dataURL='chartxml/data2.xml? + math.random()'&chartWidth=900&chartHeight=300
0
 
ehart12Author Commented:
Hi duncancumming,

Thank you very much for the #getTickCount# idea. The code that works for me is as follows:

param name="FlashVars" value="&dataURL=chartxml/data2.xml?nocache=#GetTickCount()#&chartWidth=900&chartHeight=300"

Thanks again and have a wonderful day,

Eric


0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now