This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I have a textures.jar file on my server (specified with the archive parameter within the applet tag) with a class to use as an anchor and some images. When I run the applet, this is how I get to the images:
My question: How can I make sure that the applet is getting the resource from the local cached version (on the client) instead of going to the server for it?
Does this mean that every time I use a getResource() on an applet it goes to the server for it?
Does this mean that every time I use a getResource() on an applet it goes to the server for it?
No. Generally the Java Plugin will cache jar files. When the applet is loaded the Plugin checks whether the file on the server is newer than the one in the cache; if it is, it will replace the existing cached copy, but otherwise the cached copy will be used.
Note that the user can turn off jar file caching in the Plugin control panel, but by default it's turned on (and most users probably never touch those settings).
I do know that the jar files are cached by default.
I just want o know how to access the resources contained within them (the cached version, if available) as opposed to always connecting to the server version of the files.
I also want to know if this is the default behavior of applets (that is to access server resources instead of local cached resources with the getResource method) or if I'm doing something wrong.
Thank you,
regards,
Fabricio
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35446
9
posted
0
I don't quite follow. Are you saying that the jar file is retrieved every time despite caching being turned on?