Solved

Refresh image on web browser

Posted on 2014-03-27
4
484 Views
Last Modified: 2014-03-28
Hi Experts,

I generated jfree chart image on web browser and it displays different chart in FireFox when I hit different link, but not in IE9.
Since it is working FF, I am thinking it has something to do caching issue in IE.

This is the source from the popup windows that displays the chart.
I added these in head tag, but didn't help.

<meta Http-Equiv="Cache-Control" Content="no-cache">
<meta Http-Equiv="Pragma" Content="no-cache">
<meta Http-Equiv="Expires" Content="0">
<meta Http-Equiv="Pragma-directive: no-cache">
<meta Http-Equiv="Cache-directive: no-cache">



<map id="imageMap" name="imageMap">
</map>





<html>
<head>
<meta Http-Equiv="Cache-Control" Content="no-cache">
<meta Http-Equiv="Pragma" Content="no-cache">
<meta Http-Equiv="Expires" Content="0">
<meta Http-Equiv="Pragma-directive: no-cache">
<meta Http-Equiv="Cache-directive: no-cache">

<title></title>
</head>




<body>


	

	<img src="http://localhost:8080/xxxx/servlet/ChartViewer" border=0 usemap="#imageMap">

</body>
</html>

Open in new window


Any idea?
0
Comment
Question by:dkim18
  • 2
4 Comments
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 100 total points
Comment Utility
The problem you're running into is that your code only affects the caching of the main HTML page... and not the cache of the image.  Those are two separate items.  If you change the image name by even one letter in both the file name and the HTML page, you will see the new image.  This is a problem we constantly run into.  CSS and javascript files have this problem also.  Sometimes you have to directly open image, CSS, and javascript files to get the current version.  A first time visitor does not have this problem because they don't have any of the files in their browser cache.
0
 

Author Comment

by:dkim18
Comment Utility
you mean changing "ChartViewer"?
0
 
LVL 58

Accepted Solution

by:
Gary earned 400 total points
Comment Utility
One thing you can do is append the src url with a large random number or timestamp each time you generate the page that way the browser will always request a new image e.g.

http://localhost:8080/xxxx/servlet/ChartViewer?randomnumber=1245234
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Gary's right, if that's a 'generated page' then that's easy to do.  A common method appends a current timestamp to the URL.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

744 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

13 Experts available now in Live!

Get 1:1 Help Now