Sun Plugin Applet URLConnection doesn't use IE browser cache

I have a legacy applet that works fine under the old MS and Netscape jvms.  However, when I try to run it under the Sun plugin jvm (1.4.2_01), I see that the URLConnection doesn't use the browser cache.  It just reads the data directly into the applet bypassing checking to see if the file was already in IE's /Temporary Internet Files/Content.IE5.  Even after the read of the file, it's still not in the browser's cache.
I've confirmed this by monitoring the data coming over the wire with ethereal and monitor what files are being written/read from my computer using filemon.
I do have
and even tried
  Doesn't help and as I said, this code has been working fine for the past 4 years in the old netscape 4 and IE w/ MS JVM environments.
  Is there some other class that I should now be using with the Sun plugin to take advantage of the browser cache?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The plugin has its own cache in the file system
This is a bit out of date, but should help:
dcpetersonpAuthor Commented:
That cache is for applet jar files.  I'm talking about downloading normal media files.  I'm dowloading very large files (e.g. .jpg, .swf, .avi, etc) and I need to take advantage of the normal IE browser content cache.
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

Are these not contained in jar files? If you put them in jar files, not only should you get the cache control mentioned above, but in some cases, compression optimisations.
Individual files may be placed in the .jpi_cache directory
See the comment here too on URLConnection/classpath issues:
dcpetersonpAuthor Commented:
I definitely want cache controls.
The nature of my applet's functionality prevents them from being put into jar files as I want to use them in later html pages as real files outside of my applet context.  i.e. I want the browser to see them there, not just have them available to my applet.  Not only do I want the browser to see them there, I'd like the browser to see the expiration header cache controls just like it does for the old jvms.
Also, as I said above, filemon shows that no files are being written to my disk, not even to .jpi_cache.  In fact later examination of .jpi_cache/file/1.0 shows nothing there.  However, I do certainly see my applet jar file in .jpi_cache/jar/1.0
Maybe try a classpath-oriented method of loading the files, per the above link?
dcpetersonpAuthor Commented:
Yes, I've already read that java forum posting.  My apache server is definitely not setting no-cache pragmas.  As I said, this works perfectly fine with legacy jvms.  You may also want to read this java forum posting:
dcpetersonpAuthor Commented:
classpath loading mechanism?  Yes, I've read that posting before, but I don't understand what they mean by classpath loading mechanism.  However, I think that point may be moot (although for my own edification, I wouldn't mind understanding what they're suggesting) because I need the files to be seen by the browser outside of my applet context.  The primary purpose of my applet is to pre-cache files for later usage in normal browser context.
>>I wouldn't mind understanding what they're suggesting

I assume something like

URL myMediaUrl = getResource("/media/x.avi");


InputStream in = getResourceAsStream("/media/x.avi");
Mick BarryJava DeveloperCommented:
Use of browser cache is an RFE.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dcpetersonpAuthor Commented:
DO you have a link to the RFE so I can vote for it?  
Changing the way URLConnection has worked for the last 10 years w/o allowing for backward compatibility really stinks in my opinion.
So as far as you know, there isn't any mechanism for me to download a file and have it available for non-applet contexts?  No way to get it into the browser's cache?  I can't think of one.  I've tried to think of a way to pass it to javascript, but I can't think of how that would even work.
Mick BarryJava DeveloperCommented:
Last I checked the browser cache is only consulted for jar and class files. So the only workaround I know of is to rename your files extensions which doesn't help with sharing cached files with browser.

There are plans to check browser cache for all files in hopper, but that also is not a lot of help to you now.
dcpetersonpAuthor Commented:
Just for my own political commentary here, Sun developed the plugin because MS was removing support for their JVM.  You'd think that SUN would take a bit more care to make sure that things worked in the same fashion.
I've added in a bit of commentary to that RFE because it just asks for the plugin to check the browser cache.  In actuality I'd like it to check it and (at least optionally) deposit into it regardless of filetype extension.
dcpetersonpAuthor Commented:
Well, my problem isn't at all solved here, but you've been a big help in at least pointing me to where to apply leverage on Sun.  What do you think is a fair point assessment here for your help?
Mick BarryJava DeveloperCommented:
> Sun developed the plugin because MS was removing support for their JVM.  

Not really. MS removed support for their JVM well after the plugin was developed.

> You'd think that SUN would take a bit more care to make sure that things worked in the same fashion.

Agreed, there are some areas that Sun really needs to improve.

> What do you think is a fair point assessment here for your help?

They are your points, it up to you :)
>>What do you think is a fair point assessment here for your help?
I certainly don't mind if objects gets the majority of the points as he's probably provided more help
dcpetersonpAuthor Commented:
Okay, I've asked the moderators to award 75 points each to you both and to leave this open for a while.  Not sure if they can do that or not.  I'm hoping for a solution out of left field that may solve this for me, but I don't think you guys should be penalized waiting around for that.  Thanks objects & CEHJ!
dcpetersonpAuthor Commented:
great, I've asked them to switch it to 125/75 split.
Mick BarryJava DeveloperCommented:
dcpetersonpAuthor Commented:
Hey, can I impose on you guys to ask that you vote for this RFE please? 
Mick BarryJava DeveloperCommented:
My votes are all in use sorry.

We are having a similar problem -- when using the Plugin cache_option, it does not cache like it should. Could be something wrong with cache_version, I have heard. Have you guys found a fix for this problem?
dcpetersonpAuthor Commented:
Sun acknowledges that this is a missing 'feature'.  Suggest that you cast your votes w/ Sun to have the 'feature' implemented.  Get all of your co-workers, friends, family, etc to vote. We've managed to get the votes up to 131, but still Sun isn't working on it.  Pile your votes on. ;)
Now it is 132. Grrr.
dcpetersonpAuthor Commented:
FYI, you have 3 votes that you can cast.  Course you may be using the other 2 for something else....
134. Didn't know you could put all three on one.
dcpetersonpAuthor Commented:
Top 25 RFEs (request for enhancement).  You can see where we're at via the link below.  Suggest that you get friends, colleagues, whoever to vote because we're not really going anywhere fast with getting a solution for this.  About our only hope is if Microsoft and Sun partner together to put SunJava bundled into windows.  If that happens, I'm sure MS will push Sun hard to fix these things and probably even assign their own engineers to fix/test that it all runs 100% on windows.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Components

From novice to tech pro — start learning today.