This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Servlets and the fly likes Problem: Server serves old version of image. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem: Server serves old version of image." Watch "Problem: Server serves old version of image." New topic
Author

Problem: Server serves old version of image.

Girish Gopal
Greenhorn

Joined: Nov 13, 2008
Posts: 10
I run my web application in tomcat.I have some image files which gets changed frequently.But these changes doesn't get reflected in the jsp's where I show it.

I dont't think its the problem of browser is caching the image file because I have tried clearing the browser,and even tried from a browser of different system.

I also tried to attach a timestamp with the image file so that the cached version is ignored but it was of no avail.


But the changes get refreshed if I restart the server. So I believe something has to be done at the server end.

Any help on it would be appreciated ?

Thanks
Girish
Arun Christopher
Greenhorn

Joined: Nov 18, 2008
Posts: 19
Dear Girish,
Put that img tag inside a div and better try reloading the div with ajax calls at regular intevals so that the image gets changed at regular intervals.

-Arun Christopher
Girish Gopal
Greenhorn

Joined: Nov 13, 2008
Posts: 10
Dear Arun,

I think U have got me wrong. Its not the problem of refreshing the content in the browser automatically.But the problem is the image doesn't change to new one on doing a manual refresh.

It's not loading the changed image even if I try to access it with a new http request through browser .And Ajax xmlhttprequest's does'nt do anything different ,it request for the resource.

Thanks
Girish
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem: Server serves old version of image.