Solved

Refresh image on web browser

Posted on 2014-03-27
4
493 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

630 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