Link to home
Start Free TrialLog in
Avatar of 451ls
451ls

asked on

Prevent CFCHART dynamically generated image file from being cached by browsers

This is a followup to a question which MRichmon answered successfully how to create an image file using CFCHART:

https://www.experts-exchange.com/questions/21131524/Mozilla-browsers-don't-detect-image-type-for-CF-templates-with-jpg-or-png.html

It's created a new problem.

My page uses CFCHART to generate a .png file, but because the contents of the image contains dynamic
data, the browser must not get a cached version of it. The data in the image is different every time.
But I cannot assume users have all caching turned off on their browsers.

Is there anyway to make sure that the embedded .png file is not cached.

I know how to turn on page caching - but not for the embedded links.
ASKER CERTIFIED SOLUTION
Avatar of pinaldave
pinaldave
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can specify whether charts are cached in memory, the number of charts to cache, and the number of chart requests that ColdFusion can process concurrently. To set these options: in the ColdFusion Administrator, select Server Settings > Charting.

Above lines is from the macromedia documentation read the last line on this page... http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-a11.htm#wp2619630
Regards,
---Pinal
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 451ls
451ls

ASKER

Sorry for the slow response.

I know for a fact that the server is not caching the charts. A new image is created and I can see it on the server side.
The problem is entirely with the browser. Is there no way for a page to 'force' a browser to always request the current server version of an image file.

I could of course create a unique name for every file, but I am hoping for a simpler solution.
The no-cache values tell the CLIENT browser not to cache the image.

The server isn't the problem.  It is the client browser.

If you use meta tags to enforce no caching the CLIENT browser won't cache and it will work...
Avatar of 451ls

ASKER

I already had the cache controls in my page when I initially asked the question, but the embedded image was continuing to cache as long as I used the same name.
Now however, I canNOT get it to cache. So I'm assuming the client is acting correctly on the meta tags. Very bizarre.