web distribution (applet/jnlp) and asset cache

Started by ilazarte, June 16, 2009, 15:58:02

Previous topic - Next topic

ilazarte

Hey all,

I'm working on an applet that will use javascript as the main programming language for lwjgl.  That part is up and working (I borrowed an example from ciardhubh's redbook examples) and now I'd like to implement some sort of a cache for downloaded assets.

So a traditional game pipeline (as I understand it) would load the file, obtain the serialized java object, and then use that ser file to load for as many times it is valid.  Easy enough, I plan to write a servlet that loads textures or models (eventually after i steal some model loading code) and then the applet or jnlp will simply cache that on the client side and use it unless it changes on the server.

The tricky part is I dont know applets or jnlps cache files.  I had though applets had a persistent cache despite browser cache clearning but I'm learning that might not be the case.

Suggestions?

Thanks in advance!

kappa

are you using lwjgl's appletloader to deploy your applet? or some custom way to deploy lwjgl's natives?

ilazarte

Appletloader.  It loads my applet which instantiates the script context and does draw/update etc.

kappa

the applet loader has its own caching mechanism, you invoke it by using the

<param name="al_version" value="0.1">

tag inside the applet tag. If its missing, the appletloader will download the whole applet everytime, otherwise it will download the applet only once and use caching. You simply bump the number everytime to you upgrade the applet which will cause appletloader to update the cache.