We represent web pages as the abstract class Page. It is defined as follows:
class Page { public: Page(int size) : size\_(size) {} int size() const { return size\_; } int& id() { return id\_; } virtual WebPageType type() const = 0; protected: int size\_; int id\_; };
It represents the basic properties of a web page: size and URL. Upon it we derive two classes of web pages: ServerPage and ClientPage. The former contains a list of page modification times, and is supposed to by used by servers. It was originally designed to work with a special web server trace; currently it is not widely used in . The latter, ClientPage, is the default web page for all page pools below.
A ClientPage has the following major properties (we omit some variables used by web cache with invalidation, which has too many details to be covered here):
The status (32-bit) of a ClientPage is separated into two 16-bit parts. The first part (with mask 0x00FF) is used to store page status, the second part (with mask 0xFF00) is used to store expected page actions to be performed by cache. Available page status are (again, we omit those closely related to web cache invalidation):
CilentPage has the following major C++ methods: