ASE Home Page Products Download Purchase Support About ASE
ChartDirector General
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  New to ChartDirector, is it possible to avoid viewing cached graphs in a webpage?
Posted by Mario Yee on Aug-15-2007 01:59
Hi, let me explain:

First of all, sorry for my english, I?m from Mexico..

I am developing a PHP/MySQL website. I want to show some graphs so right now I?m evaluating ChartDirector.
All the graphs I want to show are created dynamically with PHP and a MySQL DB.

The problem is with the client?s browsers cache. I don?t want the browser to show a particular image from it?s own cache and not the most updated one.

In a different PHP graph library there is a method to prevent this (the method consisted in appending an unique id using a random number to the URL of the file that creates the graph).

So I would like to know if ChartDirector has a way to do the same thing?

Thanks in advance

Mario

  Re: New to ChartDirector, is it possible to avoid viewing cached graphs in a webpage?
Posted by Peter Kwan on Aug-15-2007 03:30
Hi Mario,

Yes. If the URL is generated by ChartDirector (eg. in BaseChart.makeSession), ChartDirector will always append a random number to ensure the URL is unique and so the cache is not used.

If the URL is created by your code, your code will need to append the random number.

For example, if you are using the following code:

<img src="makeMyDBChart.php?year=<?php echo $selectedYear?>">

and if you do not want to use cache, then you may append a random number, like:

<img src="makeMyDBChart.php?year=<?php echo $selectedYear?>&random=<?php echo mt_rand() ?>">

Hope this can help.

Regards
Peter Kwan

  Re: New to ChartDirector, is it possible to avoid viewing cached graphs in a webpage?
Posted by Mario Yee on Aug-15-2007 03:57
Thanks for your reply Peter, I will try that!

Mario