Will Downloading Java Applets Fill Hard Disk?

Question:
Constant downloading and fear of accumulating masses of useless files is turning me off on Internet. My concept of Java is that exe files, etc., will be on the server, thus eliminating need for constant downloads. Is it possible yet to browse the Web using programs that are there, too? If so, please direct me to the proper course.

Answer:
Java applets behave very much like any other Web data. The Java paradigmis that your applications (Java applets) reside on a Web server along withall the other Web content including HTML pages, GIF images, audio clips,and so on.

When you bring up a page that contains an applet, the applet data (class files)automatically get downloaded onto your system using the HTTP protocol. Onceenough of the applet has arrived over the network, your browser will startrunning the applet on your local system. From that point on, the browserwill retrieve any additional class files it needs on the fly from thenetwork. So while the bits reside on your server, the applet itself runson your local system within the context of the browser.

Of course, as with all other Web data, your browser will cache recentlyused Java class files on your disk. Each browser typically sets asideseveral megabytes of disk space for use a data cache. This is usefulbecause if you go back to a page that you’ve already visited, the browserwill no longer have to download the class files again, as long as theyhaven’t been updated since your last visit. To verify that the cachedata is recent, however, the browser will have to make a connection tothe Web server for each class file and verify its date of modification.If the date matches what was stored in the cache, the browser uses thelocal copy.

The data cache used by the browser does not grow indefinitely, either.As new files are placed in the cache, old ones get kicked out. Soyou’ll never accumulate the data beyond what your browser is configuredto use up — and you should be able to change this value to your likingin the preferences menu.

By the way, applets are typically very small compared to other Webdata. A typical applet is probably around 30 kbytes, thesize of a small GIF image. Of course, a large Java applet can use20 or 30 small class files, and it can get somewhat awkward tocheck the modification date onthose files every time the page is visited. One solution comingdown the road is to put all the necessary class files into an archiveand treat that one archive file as a single Web item. This featurewill be available with Java 1.1, which introduces the notion of JavaArchive (JAR) files. The advantage of a scheme like this is thatduring subsequent visits to a page only a single file has to bechecked and updated and so your browser makes fewer HTTPconnections to the Web server in order to fetch the applet.

Until JAR file support becomes ubiquitous, you can use Netscape’sown version of this solution, which is the ARCHIVE HTML tag,available in Netscape 3.0. It allows the publisher of an applet toput all the applet’s class files into an uncompressed ZIP file onthe server, and simply reference the ZIP file directly in theapplet’s HTML tag. For example:

            

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: