Solved

Prevent CFCHART dynamically generated image file from being cached by browsers

Posted on 2004-10-05
6
373 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Are date-time stamps in Microsoft IIS log files in GMT +0? 3 59
Intranet building Software 8 120
Moving web servers into a DMZ? 3 58
Problem to go to Web page 2 121
Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
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 exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…

825 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