Hi David S,
The reason the browser cache the image is such that it can avoid reloading the image if the image URL is the same as before. If the URL is not changed, the browser may not even attempt to reload the image from the server (the browser just reloads the image from cache). As a result, the chart may not be changed in the browser display.
To avoid the browser to cache the image, the proper method is to add cache control headers in the HTTP response (in the PreInit event handler). In theory, when the browser sees the cache control header, it will not cache the image. However, from our testing several years ago, the cache control header is not reliable. In some "very old browsers". The browser may ignore them and cache the image anyway, and will not reload the image from the server if the URL has not changed. That's why ChartDirector is designed to change the URL everytime by appending a unique dummy query parameter to the URL. Unluckily, there is no easy method to stop ChartDirector from adding that dummy query parameter.
I think if the browser does support the cahce control header, you may add cache control header in your ASP.NET web page, and the browser should not cache the image. If the browser does not support the cache control header, we would need to change the URL to avoid the browser from using cache.
Regards
Peter Kwan |