Solved

Prevent CFCHART dynamically generated image file from being cached by browsers

Posted on 2004-10-05
6
362 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…

919 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

17 Experts available now in Live!

Get 1:1 Help Now