The Active Cache Protocol

In Active Cache, the Web server specifies the association between a cache applet and a URL-named document by sending a new entity header, ``CacheApplet,'' with the document:

The header follows the convention for applet specification in HTML documents. It specifies that the applet ``code.class'' at code base "codebase_url" is the cache applet for the document, and associated classes are grouped in an archive [#!sun-jar-guide!#]. Codebase and archive directives are optional. Since HTTP/1.1 allows the introduction of new entity headers, and requires that if a proxy does not recognize an entity header, it should forward the header, the server can be assured that Active-Cache enabled proxies will receive the header even if they have parent proxies.

For security concerns, we require that the codebase of the applet, if present, has the same server URL as the document. That is, only the Web server can supply the applet for its documents.

An Active-Cache enabled proxy agrees to fulfill the following obligations:

In other words, the proxy will not return a cached reply to the user unless the cache applet has been executed successfully, and the applet can deposit information in the log object which will eventually be reflected to the server.

However, the proxy decides whether it wants to cache the document, when it fetches the applet and the archive, and whether it wants to invoke the applet. Furthermore, the proxy can evict any document or any applet from its cache at any time. The only constraint on the proxy is the above agreements.

Active Cache Interface

The cache applet must implement an interface called ``ActiveCacheInterface.'' Currently, we require that the applet be written in Java. The interface defines a function called FromCache. The function is called when an access hits in the document, and arguments include the user request, the client IP address, client's machine name, the document in cache, and a new file descriptor for the applet to write in the reply file. The prototype of the function is listed below:

The arguments are included based on the principle that any information that the server can gather should the request go to the server, can be seen by the cache applet. The function can only return three values: All other return values are treated as -1.

The cache applet can only call the ActiveProxy class to perform its functions. The ActiveProxy class provides the native methods for file access , cache query, locking and unlocking as well as sending requests to servers. Currently, the methods include:

As we gain more experience with the Active Cache paradigm, necessary methods will be added to the ActiveProxy class.

An applet's execution can be aborted any time. All changes to files and objects are voided if the execution is aborted. In other words, file changes are not committed until the applet finishes its execution.

The restrictions on the use of the proxy calls are the following:

Any exception is caught and result in a return of -1 for the FromCache method.

In addition to the ActiveProxy methods, the only other packages present in the Java run-time environments are java.util, java.text, java.math, and java.sql. All other packages, including, java.lang, and, are simply not loaded. The proxy can do so because the cache applet has only one purpose, that is, performing per-request processing of the document, and thus needs a very simple security interface.

Pei Cao