Solved

Refresh image on web browser

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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.
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 learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

730 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