JDK-4528599 : RFE: Support all file types in caching
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 1.3.0,1.4.0,1.4.2,5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS:
    generic,windows_nt,windows_2000,windows_xp generic,windows_nt,windows_2000,windows_xp
  • CPU: generic,x86
  • Submitted: 2001-11-16
  • Updated: 2005-04-01
  • Resolved: 2005-04-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6Resolved
Related Reports
Duplicate :  
Description
Name: gm110360			Date: 11/16/2001


java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)

The current version (1.3.1) of Java Plug-In only checks the browser cache for
files whose names end in .jar or .class. I have been told that for Java Plug-In
1.4 the browser cache will be checked for the following file
types: .class, .jar, .zip, .jpg, .gif, .wav, .au.

While this is a large improvement, I would like to see the browser cache
checked regardless of file type. Our app has thousands of data files (about 500
meg) whose names end in ".bin" and I would like them to be cached. This would
produce a dramatic improvement in performance both in the applet and on the
server that provides this data.

The java example code illustrates the problem and the workaround. You'll need
to create the image files, any 120x120 (or smaller) jpeg will do. Make five
copies of the same jpeg but with the names listed in the applet. Put the
images, the applet and the html page in the same folder on a web server. Start
your favorite browser, load the html page which runs the applet in the plug-in,
look at the server log. Close the browser and do it all again. See that .jar
and .class are cached (status 304) but .jpg, .gif, .zip are not and are loaded
by user-agent Java 1.3.1. Also see that the images are loaded correctly
regardless of file name (the workaround).

Here is my log, apache combined file format:
10.1.1.105 - - [16/Nov/2001:10:03:41 -0500] "GET /imagecaching.html HTTP/1.1"
200 2136 "-" "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"
10.1.1.105 - - [16/Nov/2001:10:03:44 -0500] "GET /imagecaching.class HTTP/1.1"
200 1345 "-" "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"
10.1.1.105 - - [16/Nov/2001:10:03:44 -0500] "GET /bill.jar HTTP/1.1" 200 8246 "-
" "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"
10.1.1.105 - - [16/Nov/2001:10:03:44 -0500] "GET /bill.class HTTP/1.1" 200
8246 "-" "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"
10.1.1.105 - - [16/Nov/2001:10:03:44 -0500] "GET /bill.jpg HTTP/1.1" 200 8246 "-
" "Java1.3.1"
10.1.1.105 - - [16/Nov/2001:10:03:44 -0500] "GET /bill.gif HTTP/1.1" 200 8246 "-
" "Java1.3.1"
10.1.1.105 - - [16/Nov/2001:10:03:44 -0500] "GET /bill.zip HTTP/1.1" 200 8246 "-
" "Java1.3.1"
10.1.1.105 - - [16/Nov/2001:10:04:14 -0500] "GET /imagecaching.class HTTP/1.1"
304 - "-" "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"
10.1.1.105 - - [16/Nov/2001:10:04:14 -0500] "GET /bill.jar HTTP/1.1" 304 - "-
" "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"
10.1.1.105 - - [16/Nov/2001:10:04:14 -0500] "GET /bill.class HTTP/1.1" 304 - "-
" "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"
10.1.1.105 - - [16/Nov/2001:10:04:14 -0500] "GET /bill.gif HTTP/1.1" 200 8246 "-
" "Java1.3.1"
10.1.1.105 - - [16/Nov/2001:10:04:14 -0500] "GET /bill.zip HTTP/1.1" 200 8246 "-
" "Java1.3.1"
10.1.1.105 - - [16/Nov/2001:10:04:14 -0500] "GET /bill.jpg HTTP/1.1" 200 8246 "-
" "Java1.3.1"




HTML page to load applet:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Image Caching AWT Applet - Examples</title>
</head>

<body>
<table border="0" cellspacing="0" cellpadding="0" width="780">
<tr>
<td align="left" valign="top">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td align="left" valign="top">
<!--"CONVERTED_APPLET"-->
<!-- HTML CONVERTER -->
<SCRIPT LANGUAGE="JavaScript">
<!--
var _info = navigator.userAgent;
var _ns = false;
var _ns6 = false;
var _ie = (_info.indexOf("MSIE") > 0 &&
_info.indexOf("Win") > 0 &&
_info.indexOf("Windows 3.1") < 0);
//-->
</SCRIPT>

<COMMENT>
<SCRIPT LANGUAGE="JavaScript1.1">
<!--
var _ns = (navigator.appName.indexOf("Netscape") >= 0 &&
((_info.indexOf("Win") > 0 &&
_info.indexOf("Win16") < 0 &&
java.lang.System.getProperty("os.version").indexOf("3.5") < 0) ||
(_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0) ||
(_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0)));

var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >= 0));
//-->
</SCRIPT>
</COMMENT>

<SCRIPT LANGUAGE="JavaScript">
<!--
if (_ie == true)
document.writeln('<OBJECT classid="clsid:CAFEEFAC-0013-0001-0000-ABCDEFFEDCBA" WIDTH = 658 HEIGHT = 650 codebase="http://java.sun.com/products/plugin/1.3.1/jinstall-131-
win32.cab#Version=1,3,1,0"><NOEMBED><XMP>');

else if (_ns == true && _ns6 == false)
document.writeln('<EMBED type="application/x-java-applet;jpi-version=1.3.1" CODE = "imagecaching.class" CODEBASE = "." WIDTH = 658 HEIGHT = 650 pluginspage="http://java.sun.com/products/plugin/1.3.1/plugin-install.html"><NOEMBED><XMP>');
//-->
</SCRIPT>
<APPLET CODE = "imagecaching.class"
codebase="."
WIDTH = 658
HEIGHT = 650
id=Applet1></XMP>
<PARAM NAME = CODE VALUE = "imagecaching.class" >
<PARAM NAME = CODEBASE VALUE = "." >
<PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.3.1">

</APPLET>
</NOEMBED></EMBED></OBJECT>

<!--
<APPLET CODE="imagecaching.class"
CODEBASE = "."
WIDTH = 658
HEIGHT = 650>
</APPLET>
-->
<!--"END_CONVERTED_APPLET"-->
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>






Java applet source code:
import java.awt.*;
import java.awt.image.*;
import java.applet.Applet;

public class imagecaching extends Applet
{ 
    Image imagejpg = null;
    Image imagegif = null;
    Image imagejar = null;
    Image imageclass = null;
    Image imagezip = null;

    public void init()
    {
        // The data: 5 identical copies of a 120x120 jpeg image
        // The files are named with different extensions to see the effect
        // of the filename on whether they are loaded from the
        // browser cache or whether the applet goes directly to the server
        // The files are in the same directory as the applet and the
        // applet is run in the Java Plug-In 1.3.1
        // Watch the web server's log for two things, the status code
        // and the user agent. For .jpg, .gif and .zip the useragent is Java
1.3.1
        // for .jar and .class it is the browser (MSIE on win2k)
        imagejpg = getImage(getCodeBase(), "bill.jpg");
        imagegif = getImage(getCodeBase(), "bill.gif");
        imagejar = getImage(getCodeBase(), "bill.jar");
        imageclass = getImage(getCodeBase(), "bill.class");
        imagezip = getImage(getCodeBase(), "bill.zip");
    }

    public void paint(Graphics g)
    {
        int x = 10;
        int y = 30;
        mydrawimage(g,imagejpg,x,y,"bill.jpg");
        x += 128;
        mydrawimage(g,imagegif,x,y,"bill.gif");
        x += 128;
        mydrawimage(g,imagejar,x,y,"bill.jar");
        x += 128;
        mydrawimage(g,imageclass,x,y,"bill.class");
        x += 128;
        mydrawimage(g,imagezip,x,y,"bill.zip");

    }

    public void mydrawimage(Graphics g, Image image, int x, int y, String label)
    {
        if(image != null)
        {
            g.drawImage(image,x,y,this);
            g.drawString(label,x,y+10+image.getHeight(this));
        }
    }
}
(Review ID: 135813) 
======================================================================

Name: gm110360			Date: 08/29/2002


FULL PRODUCT VERSION :
java version "1.4.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)

FULL OPERATING SYSTEM VERSION :Microsoft Windows 2000
[Version 5.00.2195]


A DESCRIPTION OF THE PROBLEM :
When running applets that use .gifs they are no longer in
the browser cache (temporary internet files) nor are they
in the plugin cache.  .class and .jar are there but
not .gif.

Images are instantiated using Applet.getImage(URL).

Everything is cached with the Microsoft VM and previous
versions of the applet but not with 1.4.

REGRESSION.  Last worked in version 1.3

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.run applet
2.view cache
3.

EXPECTED VERSUS ACTUAL BEHAVIOR :
I expected to see a listing of the .gifs with the .classes
and .jars

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER WORKAROUND :
images can be placed in jars, but because of the amount of
images it is problematic.
(Review ID: 163747)
======================================================================

Comments
EVALUATION Committed to Hopper. ###@###.### 2002-03-01 uncommit to hopper. Not on our fix list. ###@###.### 2002-03-20 Commit to tiger ###@###.### 2002-07-30 Reassign to Rajani. ###@###.### 2003-01-15 This is related to the Unified download engine work. Reassign to Thomas. ###@###.### 2004-11-10 00:20:32 GMT As the synopsis of this bug suggest, this is only for adding support to cache all file types in the current plugin cache. This support is targeted for mustang (6.0). For browser cache support in java plugin, please refer to RFE 6230311. ###@###.### 2005-2-17 01:27:31 GMT this is fixed as part of 4802551: Consolidate Download Engine and Cache from plugin and webstart ###@###.### 2005-04-01 23:30:44 GMT
17-02-2005

WORK AROUND Name: gm110360 Date: 11/16/2001 Renaming a file to end with .jar or .class will cause the applet to check the browser cache first, but I don't know what effect this has on performance as the real content type will be different from what would be guessed from the file name. I also haven't checked for calls other than getImage(). ======================================================================
28-07-2004