Close

Trouble with CFChart – Image expired

Thanks to the few users who acknowledged my last post on the topic of CFChart. I hope it has been (and will continue) useful to even more people. One particular developer, delta_mu, commented on a problem he was having when using the CFChart as explained in my post.

When a user reaches a page with cfcharts in flash format by clicking the browser ‘back’ button, instead of the original flash chart, an image that says “Image expired. Please refresh the page to view the image” is displayed.(Sample image shown below) Very clearly, not desirable.

The problem occurs for two reasons.

Lack of session management.
Short image caching duration.

When we use the cfchart tag to create a chart, coldfusion creates a temporary SWF or JPG or PNG image for display. If no session management is enabled, the cluster manager will send the user to a different server each time and hence there will not be any image to display. This can be prevented by enabling session management and the process is called session affinity.

However, in this user’s case, I doubt whether this was the case as he most probably uses a developer edition for such purposes and hence no clustering is involved as it is a single server setup. Thus it must be reason number two – The cache.

Once a request has been made, by default, the images will only kept for a duration of 5 seconds in the cache. Hence when the user hits the back button, the request no longer exists. This duration can be extended by following the few simple steps listed below, courtesy Prayank’s blog.

Stop the CFServer.
Open coldfusion x.x\lib\webcharts3d.xml
Find and change the values “minTimeOut” & “maxTimeOut”.
Restart the server.

Thats it. You are ready to go. But please remember that this solution is inefficient when you have a large number of charts to display.

Latest stories

  • 7 Proven Hacks to Enhance Your Mobile App User Experience

    In this digital age of fierce competition, quality and performance easily outweigh brand loyalty. Creating a fluid user experience is essential for the  success of any mobile app. Efficient user experience UX is the backbone of a visually appealing and engaging app. It can either make or break an app.  Here are a few considerations […]

  • Things To Know About App Testing During Development

    With years of experience in app development and testing, we give utmost importance to quality assurance in mobile application development. Our team of adroit software testers ensures that quality assurance is an integral part of the development lifecycle right from ideation to deployment and in post-development reviews. Here are a few things the QA engineers […]

  • Go Live: 6 Things To Do Before Publishing an App

    After years of publishing applications to the app store, our team has come up with a checklist showcasing important things to do before publishing your app on Google Play or Apple App Store. Without further ado, let’s get started.  #1.Thoroughly Understand The App Store Policies and Guidelines It is vital to understand the app publishing […]

Leave a Reply

Your email address will not be published. Required fields are marked *