Thursday, June 23, 2005

Image expired trouble?

Problem
The following message is shown instead of the graphs:
"Image Expired
Please refresh the page
To view the image"


Lot of people have faced this problem, the reason is the timeout in the caching engine of the Coldfusion keeps the charts for any request only for a default value of 5 seconds.
We missed providing an interface to change this value in the CF Admin, but you can still change this value by:

1. Stop the CF server.
2. Open <cf install path>\lib\webcharts3d.xml
3. You can increase the timeout for keeping the graphs in the cache by editing the minTimeout and maxTimeout attributes:

<?xml version="1.0" encoding="UTF-8"?>
<server image="PNG" cache="Memory" minTimeout="5000" maxTimeout="30000"....

change this to whatever values you want.(Values of minTimeout and maxTimeout are in milliseconds.)

The minTimeout and maxTimeout are per each request, i.e. the graphing cache will keep the graphs for each request for minTimeout amount of time. So if there are 4 graphs in one page then request for the page arrives at lets say 1'o clock and the min timeout is 5 secs, then each graph for the request will be kept only in cache for 1'o clock + time to generate graph + minTimeout. So a problem could be if the last graph takes lets say 10 secs to generate, then by the time it is ready all the previous graphs will timeout and will be removed from the cached.

This can create a problem when:


  1. There are a large number of charts one page (> 200). In this case, some charts will be drawn but remaining charts will display the error message

  2. There are only a few charts on a page but some charts take more than minTimeOut amount of time to generate in this case the remaining charts will not be generated and the error message will be thrown.

82 comments:

Anonymous said...

Yaar, Fundoo CFChart blog. Bole toh, roz aana padega.

-- Arindam Biswas (Coldfusion Developer & RIA Enthusiast)

Anonymous said...

this is probably extremely stupid, but i cannot find the file
lib/webchart3d.xml

seems it should be in
c:/cfusionMX/lib/webcharts3d.xml

but its not. I'm running
coldFusionMX
thx
d

prayank said...

Sorry for the trouble. I should have specified this post is meant for CF7 - Blackstone and not CFMX 6.1

Steve Walker said...

Can we add this property to an external xml file like you can the style properties? (For those of us using a third-party hosting company, we can't access the primary CF Server files)

prayank said...

Right now there is no way to do this, this is supposed to be a server wide setting. It will affect all applications on the CF server.

You can request your CF hosting provider to increase this limit to more - there is no performance hit (it only improves) - only issue could be that more cache space will be used up. (but I guess they can live with it)

terry said...

Thanks for a good tip!

BTW, I found difficulty with load ballancing system. Some images still expire. Any idea on this?

prayank said...

1) What kind of load balancing are you doing Terry ?

2) How many charts are there in total on your page?
- Make sure that the cache size of charting is more than the no. of charts on your page.
- You can find out how much time your entire page takes to load up by turning on the debugging from admin. This will help you in finding out if the minTimeout and maxTimeout that you have set are adequate or not.

Do mail in with any experiments that you do, you can mail me at - pswaroop (at) macromedia (dot) com or prayank.swaroop (at) gmail (dot) com

Anonymous said...

Great find - this works !! ... thanks

Anonymous said...

Amazing that this information isn't found at macromedia.com. Their fix for this problem is to make sure you have sticky sessions enabled. Thanks for the great tip!

Anonymous said...

FYI, I run a report thats over 300 pages long (about 3-5 graphs per page) and I had the same issue with the graphs. What I do is generate my graph as a png with cfchart, then immediately save it with cffile, then I reference the image later in my page. So something like this: (fyi, tag brackets are removed so I can put cf code in this box)

cfchart name="TotalsChart" format="png" .....
cfchartseries.....
cfchartdata ...... /
/cfchartseries
/cfchart

cffile action="write" file="#webroot#\images\charts\MyChart.png" output="#TotalsChart#" nameconflict="overwrite"

Then later in my display code I just call the chart like any other image file:
img src="../images/charts/CumulativeYTDChart.png" width="550" height="275"

Some things I have learned is that you really need to specify your height and width of your chart when you create it, and when you call it in the img tag.

Another helpful tip is to run a cf script as a scheduled task nightly (or whenever) to delete the imgs. this is just nice to keep the server clutter free.

Anonymous said...

since this solution only applies to version 7, is there a solution for version 6.1?

Anonymous said...

since this solution is only for version 7, is there another solution for version 6.1.

Anonymous said...

I'm running CFMX 6.1 on linux. Does this file exist on my version and if so where would I find it?

Thanks,
Brad

prayank said...

This post is for CFMX 7. Unfortunately CF 6.1 does not have such a feature.

Ajas Mohammed said...
This post has been removed by a blog administrator.
Ajas Mohammed said...

Hi,
We are using CF7 and right now we are having same Image expired problem. I checked the webcharts3d.xml file.. mintimeout is 30000 and maxtimeout is 60000 plus the cache is set as 100 and cache="Memory". I dont know why we are still facing this issue...
To add to this, I think we are using a seperate report server for the reports generation... Do you think this might cause the prob...

We have 2 machines which host this prodn site and they are load balanced ... we tried to set mintimeout 30000 and maxtimeout as 60000 on the both the webservers by stopping and restarting cf servers but it didnt work... the image are not shown...

In cf administrator under Server Settings --> Charting, the cache type is set as Disk Cache and Disk Cache Location was set as \\10.1...8\foldername which is the report server I mentioned and this is where we want to store the chart images....Can you help on this asap...

I tried the same settings on development machine and since the Disk Cache Location is a local machine, it didnt give any problems with images. I could easily test by waiting for 30 secs and image would expire after that...

Any suggestions for prodn system is welcome.

Thanks in advance,
reply @ ajashadi@yahoo.com.

Ajas Mohammed said...

Hi,
We are using CF7 and right now we are having same Image expired problem. I checked the webcharts3d.xml file.. mintimeout is 30000 and maxtimeout is 60000 plus the cache is set as 100 and cache="Memory". I dont know why we are still facing this issue...
To add to this, I think we are using a seperate report server for the reports generation... Do you think this might cause the prob...

We have 2 machines which host this prodn site and they are load balanced ... we tried to set mintimeout 30000 and maxtimeout as 60000 on the both the webservers by stopping and restarting cf servers but it didnt work... the image are not shown...

In cf administrator under Server Settings --> Charting, the cache type is set as Disk Cache and Disk Cache Location was set as \\10.1...8\foldername which is the report server I mentioned and this is where we want to store the chart images....Can you help on this asap...

I tried the same settings on development machine and since the Disk Cache Location is a local machine, it didnt give any problems with images. I could easily test by waiting for 30 secs and image would expire after that...

Any suggestions for prodn system is welcome.

Thanks in advance,
reply @ ajashadi@yahoo.com.

Anonymous said...

We have 4 boxes behind a CISCO load balancer. I tried setting the cache directory on each box to a common network share, but that didn't seem to work. In the end, I'm just going to capture the output of <cfchart> using <cfsavecontent> and then replace the image reference from a relative path to one that points to the same machine handling the request.

Anonymous said...

note: if you are outputting a huge number of graphs, you may need to adjust the cachesize setting in the same line of XML.

Anonymous said...

This page is an excellent reference.
Thank you to everyone for their contributions and discussion!

<a href="http://paydayadvisors.org">PaydayLoans</a> said...

2AhzL8 You have a talant! Write more!

<a href="http://tes.uab.es/MISS/portal_memberdata/portraits/twkgxziok">Auto insurance company</a> said...

colWSs Please write anything else!

<a href="http://hydrocodone.99k.org/index.php">Hydrocodone</a> said...

vM59AD The best blog you have!

<a href="http://users2.titanichost.com/buyviagra/136.html">instant personel loans</a> said...

foqum4 Nice Article.

<a href="http://free.7host07.com/nmcfgy/305.html">alpine air girdwood tour</a> said...

Wonderful blog.

<a href="http://fioricet.clanteam.com/?pharma=221">fioricet brand name tablet</a> said...

Good job!

<a href="http://celebrex.zxq.net/?pharma=1604">lithium celebrex</a> said...

Thanks to author.

<a href="http://m1.aol.com/BrettHead14/85.html">pearl loans reviews</a> said...

Wonderful blog.

<a href="http://users2.titanichost.com/buyviagra/index17.html">cialis and viagra purchase online</a> said...

Nice Article.

<a href="http://xenical.newsit.es/2006-february-mt-xenical.html">2006 february mt xenical</a> said...

Magnific!

<a href="http://xanax.newsit.es/mixing-heroin-and-xanax.html">mixing heroin and xanax</a> said...

Nice Article.

<a href="http://xanax.newsit.es/home-loans-xanax.html">home loans xanax</a> said...

Wonderful blog.

<a href="http://phentermine.whdot.com/index3.html">buy phentermine online genuine cheap phentermine ph</a> said...

Thanks to author.

<a href="users2.titanichost.com/amalopra">JohnBraun</a> said...

D0hfpc write more, thanks.

<a href="http://users2.titanichost.com/popebatret/index22.html">comix virtual sex</a> said...

Nice Article.

<a href="http://users2.titanichost.com/inoryum/index7.html">download sex vixen</a> said...

Good job!

<a href="http://users2.titanichost.com/hviler/index26.html">anime shemale sex</a> said...

Magnific!

<a href="http://users2.titanichost.com/ansfur/index3.html">lesbian naked sex</a> said...

Hello all!

<a href="http://users2.titanichost.com/olds77/index32.html">household anal</a> said...

Wonderful blog.

<a href="http://users2.titanichost.com/shingro/index22.html">sex and hardcore</a> said...

actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

<a href="http://users2.titanichost.com/scersi/index11.html">ebony sex star</a> said...

Hello all!

<a href="http://users2.titanichost.com/t1fielde/index20.html">pa morgana sex</a> said...

Nice Article.

<a href="http://users2.titanichost.com/adjutes/index.html">bangkok sex shows</a> said...

actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

<a href="http://users2.titanichost.com/adjutes/index19.html">beach video sex</a> said...

Nice Article.

<a href="http://users2.titanichost.com/shiconta/index34.html">cristiano ronaldo sex</a> said...

Hello all!

<a href="http://users2.titanichost.com/gnites3/index24.html">hot webcam sex</a> said...

Please write anything else!

<a href="http://users2.titanichost.com/marymeno/index20.html">raider sex tomb</a> said...

Energizer Bunny Arrested! Charged with battery.

<a href="http://users2.titanichost.com/vadhoms/index26.html">making sex happen</a> said...

Give me ambiguity or give me something else.

<a href="http://users2.titanichost.com/etooking/index35.html">nude shower sex</a> said...

Suicidal twin kills sister by mistake!

<a href="http://users2.titanichost.com/swiseny/index27.html">dog women sex</a> said...

Build a watch in 179 easy steps - by C. Forsberg.

<a href="http://users2.titanichost.com/Lostsoldier3/index21.html">free hardcore videos amature porn&lt;</a> said...

Suicidal twin kills sister by mistake!

<a href="http://users2.titanichost.com/pyzoid/index23.html">brazillian sex clips</a> said...

Thanks to author.

<a href="http://users2.titanichost.com/pyzoid/index15.html">bride sex porn</a> said...

actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

<a href="http://users2.titanichost.com/selli83/index26.html">adult sex questions</a> said...

Lottery: A tax on people who are bad at math.

<a href="http://users2.titanichost.com/numdaso/index24.html">japan sex teen</a> said...

A lot of people mistake a short memory for a clear conscience.

<a href="http://users2.TitanicHost.com/senatra/hydrocodone-bit-acet-5-500mg.html">hydrocodone bit ac</a> said...

The gene pool could use a little chlorine.

<a href="http://cialis.whdot.com/index23.html">cheap generic drugs viagra cialis levitra</a> said...

Oops. My brain just hit a bad sector.

<a href="http://web.archive.org/web/20070818074049/xanga.com/buyultramonline">order ultram</a> said...

If ignorance is bliss, you must be orgasmic.

<a href="http://users2.titanichost.com/numdaso/index8.html">italia sex pics</a> said...

Build a watch in 179 easy steps - by C. Forsberg.

<a href="http://users2.titanichost.com/febisko/index20.html">beyonce sex pics</a> said...

The gene pool could use a little chlorine.

<a href="http://users2.titanichost.com/topletrufus/index33.html">giraffes having sex</a> said...

All generalizations are false, including this one.

<a href="http://users2.titanichost.com/yetzeit/index28.html">asian sex academy</a> said...

Calvin, we will not have an anatomically correct snowman!

<a href="http://users2.titanichost.com/brittanyrogers/36-0411.html">all chicks sex</a> said...

What is a free gift ? Aren't all gifts free?

<a href="http://users2.titanichost.com/glicia80/index31.html">sex around 45123</a> said...

What is a free gift ? Aren't all gifts free?

<a href="http://users2.titanichost.com/reekello/index11.html">damy i sex</a> said...

When there's a will, I want to be in it.

<a href="http://users2.titanichost.com/tortene/index24.html">onyx sex game</a> said...

What is a free gift ? Aren't all gifts free?

<a href="http://users2.TitanicHost.com/kopelar/clonidine-suicide.html">clonidine suicide</a> said...

Oops. My brain just hit a bad sector.

name said...

Nice Article.

<a href="http://users2.titanichost.com/cuhozhilov/index.html">download porn clips</a> said...

Friends help you move. Real friends help you move bodies.

<a href="http://users2.titanichost.com/robertf/index26.html">teen teen porn</a> said...

Magnific!

<a href="http://users2.titanichost.com/maxeevich/index33.html">animai porn</a> said...

What is a free gift ? Aren't all gifts free?

<a href="http://users2.titanichost.com/dityroe/index8.html">lesbian sex spread</a> said...

When there's a will, I want to be in it.

<a href="http://users2.titanichost.com/liperwo/index4.html">auction sex slave</a> said...

I'm not a complete idiot, some parts are missing!

<a href="http://users2.titanichost.com/dasistorama/index9.html">galliers porn beastly clips</a> said...

Please write anything else!

<a href="http://users2.titanichost.com/rego07/index24.html">cmt porn</a> said...

Give me ambiguity or give me something else.

<a href="http://users2.titanichost.com/artinko/index25.html">guji porn punjab</a> said...

Good job!

<a href="http://users2.titanichost.com/lindafmosley/index2.html">anal sex free sample</a> said...

Save the whales, collect the whole set

<a href="http://users2.titanichost.com/tereritoa1/36-0411.html">free tanny sex</a> said...

Good job!

<a href="http://users2.titanichost.com/deswef/index27.html">cartoon sex directory</a> said...

Wonderful blog.

Ahamad said...

PLease post only relevant comments here.

anabel said...

this is not a solution to the cfgraph problem. still the issue

Anonymous said...

In my opinion it is obvious. I recommend to you to look in google.com [url=http://cgi1.ebay.fr/eBayISAPI.dll?ViewUserPage&userid=acheter_levitra_ici_1euro&achat-levitra]acheter levitra generique[/url] In my opinion you are not right. I can defend the position. Write to me in PM.