views:

77

answers:

2

I need to quit firefox and restart it in order for the applet to be refreshed... its anoying since i'm still programming it an the class files changes... am i missing some codes which makes it unable to refresh the applet and still take the one from the cache???

So I have a .jar applet in my website, a simulation game that spawns army whenever user clicks on the screen... however whenever I refresh the page, the previous army are still there on the screen.. I want it to be refreshed (as if we're just starting to run the application the first time).

Any Suggestions?

I'd really appreciate it

Thank you....

+1  A: 

I imagine that Firefox is caching the JAR file it has "downloaded". Typically hitting CTRL+F5 will force the browser to download any cached resources again from the webserver.

Kris
Thank you, but I was wondering if that can be implemented in somekind of javascript or something so that the user doesn't have to hit "CTRL+F5" manually?Because I assume most of my users are non programmer... Thanks again
tommy-susanto
Sorry.. I was running mac, so i didn't realize, but actually even "CTRL+F5" won't work... > <
tommy-susanto
A: 

Each time you build a new Jar applet add a build number to it, eg applet.jar?build=123 or build123/applet.jar. This is good practice for deployment too as it removes all cache concerns and this can probably be simply automated by your build solution eg Ant.

In addition it is worth considering using the separate_jvm tag, detailed here. Available since 1.6 update 10. It will ensure a new JVM each refresh which prevents you worrying about plug-in idiosyncrasies eg out of memory exceptions due to a lot of refreshes.

Pool