Solved

Refresh image on web browser

Posted on 2014-03-27
4
490 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 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 100 total points
ID: 39960519
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
ID: 39960526
you mean changing "ChartViewer"?
0
 
LVL 58

Accepted Solution

by:
Gary earned 400 total points
ID: 39960527
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 83

Expert Comment

by:Dave Baldwin
ID: 39960612
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

828 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