Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Prevent CFCHART dynamically generated image file from being cached by browsers

Posted on 2004-10-05
6
Medium Priority
?
408 Views
Last Modified: 2013-12-20
This is a followup to a question which MRichmon answered successfully how to create an image file using CFCHART:

http://www.experts-exchange.com/Web/WebDevSoftware/ColdFusion/Q_21131524.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.
0
Comment
Question by:451ls
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 21

Accepted Solution

by:
pinaldave earned 1000 total points
ID: 12234045
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<cfheader name="Pragma" value="no-cache">
<cfheader name="cache-control" value="no-cache, no-store, must-revalidate">


you can use any one of the above mentioned four lines.

0
 
LVL 21

Expert Comment

by:pinaldave
ID: 12234054
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
0
 
LVL 35

Assisted Solution

by:mrichmon
mrichmon earned 1000 total points
ID: 12238777
either pinaldave's answer or an alternate is to have the image name change each time - like using  random value or basing it off of the date (which is better so you can have automated cleanup).

But the nocaching sis probably the best option....
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

Author Comment

by:451ls
ID: 12377098
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.
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 12377324
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...
0
 

Author Comment

by:451ls
ID: 12377893
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.
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question