Solved

Prevent CFCHART dynamically generated image file from being cached by browsers

Posted on 2004-10-05
6
353 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
  • 2
  • 2
  • 2
6 Comments
 
LVL 21

Accepted Solution

by:
pinaldave earned 250 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 250 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Collapseable list of URLs. 10 100
Systems talking to each other 5 110
javascript to html map 8 41
Nameserver and MX Record 2 46
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
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 integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now