I am creating a Java applet that includes downloading images between other resources of the URL. I have come to know that the images are being cached, and they can see them under Temporary Internet Files / Views ... / resources in the Java Control Panel. Unfortunately, I need to be able to update the images and these updates appear between the hang of the applet, but the cash is causing problems.
I am not getting any information about these types of caching resources. Is the resource caching resources and how do I control it? Especially how do I set the closing time for images, or maybe even specific images?
If it is relevant, then I am downloading the images using code like this: (mount is a mediatrack object).
public BufferedImage getImageFromUrl (string url) {image img = null; Try {url u = new url}; Img = java.awt.Toolkit.getDefaultToolkit (). CreateImage (U); Mt.addImage (IMG, numbers ++); Mt.waitForAll (); ... Thanks for any help.
Use this to avoid cached images from the server:
Url u = new url (url); URL Connection Connection = u.openConnection (); Con.setUseCaches (wrong); Img = Toolkit.getDefaultToolkit (). CreateImage (new URLImageSource (U, Kon)); If you want control over end time, you can specifically terminate the cache-control or headings like Can be set by adding: con.addRequestProperty ("cache-control", "no-cache, max-age = 3600"); Con.addRequestProperty ("Ended", "Thursday, 17 March 2011 01:34:00 GMT");
Comments
Post a Comment