next up previous
Next: Recommended improvements Up: Implementation Previous: Connection handling

Cache Management

As stated in my previous design report, the cache manager uses a simple hash table and does table lookups to check the cache.

Using this framework and taking advantage of the plethora of utility functions included with it, implementing the caching mechanism of choice is not particularly hard.

The cache implementation can be roughly divided into two parts, cache reading and cache writing:

The expire date of each cache entry is set to a constant time period, defined as a global constant by the user. Expired cache entries are checked every time the cache is accessed, and deleted if expired. The cache is also purged of expired entries when the cache mapping is periodically written to disk.

Writing the cache mapping periodically to disk was nicely implemented in Jeremy's and Seth's framework. This allows a graceful reboot after a system crash, since most of the already written cache can be re-used. I decided to incorporte that implementation into my version, even though my original design listed it as a possible future project, since the code was already at hand.


next up previous
Next: Recommended improvements Up: Implementation Previous: Connection handling
Magnus Bjornsson
1998-05-08