Databases Reference
In-Depth Information
Sample HTML news page
Dependency tree of page components
Page
Header
Article
Article
Article
Article
Article
Article
Ad
Header
Content
Footer
Ad
Left
Left
Center
Right
Ad
Article
Article
Article
Ad
Ad
Ad
Footer
Image
Headline
Teaser-test
Figure 10.12 Web pages for a typical news site are generated using a tree structure.
All components of the web page can be represented in a dependency tree. As low-level
content such as news or ads change, only the dependent parts of the web page need
to be regenerated. If a low-level component changes (heavy-line links), then all
ancestor nodes must be regenerated. For example, if some text in a news article
changes, that change will cause the center section, the central content region, and the
entire page to be regenerated. Other components such as the page borders can be
reused from a cache layer without regeneration.
can avoid calling the same functions on the same input data and reuse information
fragments that are expensive to generate.
NetKernel knows what functions are called with what input data, and uses a URI to
identify if the function has already generated results for the same input data. NetKer-
nel also tracks URI dependencies, only re-executing functions when input data
changes. This process is known as the golden thread pattern. To illustrate, think of
hanging your clean clothes out on a clothes line. If the clothes line breaks, the
clothes fall to the ground and must be washed again. Similarly, if an input item
changes at a low level of a dependency tree, all the items that depend on its content
must be regenerated.
NetKernel automatically regenerates content for internal resources in its cache
and can poll external resource timestamps to see if they've changed. To determine if
any resources have changed, NetKernel uses an XRL file (an XML file used to track
resource dependencies) and a combination of polling and expiration timestamps.
10.2.2
Using NetKernel to optimize component regeneration
The NetKernel system takes a systematic approach to tracking what's in your cache
and what should be regenerated. Instead of using hashed values for keys, NetKernel
constructs URI s that are associated with a dependency tree and uses models that calcu-
late the effort to regenerate content. NetKernel performs smart cache-content optimi-
zation and creates cache-eviction strategies by looking at the total amount of work it
takes to generate a resource. NetKernel uses an ROC approach to determine the total
effort required to generate a resource. Though ROC is a term specific to NetKernel, it
 
Search WWH ::




Custom Search