Optimizing File Downloads

AppletFile contains advanced features that allow you to reduce the amount of time and network bandwidth required to complete download operations.

Using AutoZIP compression
Using AutoSYNC to handle file updates
Exploiting the browser's file cache


Using AutoZIP compression

AppletFile's AutoZIP technology allows files compressed in ZIP format to be decompressed on the fly. This can significantly reduce download times as well as the load on your network. If you are downloading files that contain mostly text and bitmap graphics, you can expect to see your download times cut in half.  And if you are already archiving your files on the server in ZIP format to save space, your clients no longer need to purchase, install, or run the necessary 'unzip' software after they finish the download.

For downloading from existing ZIP archives, add the following parameter to your download page:

<PARAM NAME="autoZipUrl" VALUE="archive.zip">

Where archive.zip is the name of the ZIP archive.

To further optimize downloading, the autoZipUrl parameter can reference a server-side script capable of generating the ZIP archive on the fly. When used in conjunction with the postZipFiles parameter, you can generate a ZIP archive that contains only the requested files. This trade off puts a higher load on the server to reduce the load on your network. For a working example of this technique, refer to the Active Server Pages (*.asp) version of the Custom Cart sample application that uses ActiveFile to generate the ZIP archive on the server.


Using AutoSYNC to handle file updates

The autoSync parameter allows you to specify the replacement policy for handling existing files. If you are periodically updating the same set of files on the client, you can use this parameter to automatically skip files that do not need to be downloaded. For example, to only download new or updated files, add the following autoSync setting to your download page:

<PARAM NAME="autoSync" VALUE="NEWER">

Exploiting the browser's file cache

By default, AppletFile always bypasses the browser's file cache and downloads the file directly from the web server. By setting the useCache parameter to true, you can take advantage of the browser's file cache. Instead of downloading directly from the web server, AppletFile will first check to see if the file is in the browsers cache. If the file is in the cache and has the same date as the one on the web server, AppletFile will copy the file from the cache. And in the case where a connection is lost during the download, AppletFile will be able to restart the download at the point where it left off by copying the first part of the file from the cache.