Creating an Http/Cache requires the same set of parameters as Http/Client and Http/Server. After creation, a cache needs to connect to a certain server. Note that this creation can also be done dynamically, when a request comes in and the cache finds that it's not connected to the server. However, we do not model this behavior in current code. Following code is an example:
set cache [new HttpCache \$ns \$node] # attach cache to \\$node; \$cache connect \$server # connect to \\$server;
Like Http/Server, an Http/Cache object waits for requests (and packets from server) after it's initialized as above. When hierarchical caching is used, the following can be used to create the hierarchy:
\$cache set-parent \$parent # set parent cache;
Currently all TTL and multicast invalidation caches support hierarchical caching. However, only the two multicast invalidation caches allows multiple cache hierarchies to inter-operate.