About Net.Data Caching

Net.Data itself provides its own caching function for frequently accessed pages and related data items generated by Net.Data macros. By delivering a page from the Net.Data cache, you save the time required to run a Net.Data macro and to access a database in order to create the page.

You can use one Cache Manager per server. Recommendation: Use one Cache Manager for many instances of Net.Data, and multiple caches per Cache Manager.

Figure 26 shows that Net.Data uses a Cache Manager to manage the caching of HTML output from a macro. This output can include data from a database.

Figure 26. Net.Data Caching


Figure dtwa1100 not displayed.

Net.Data Caching Terminology

Net.Data documentation uses the following terms to describe Net.Data caching.

cache
A type of memory that contains recently accessed data, designed to speed up subsequent access to the same data. The cache is often used to hold a local copy of frequently-used data that is accessible over a network. In Net.Data, local memory that contains Net.Data-generated HTML Web pages for reuse by the Net.Data macro. By having the pages stored in the cache, Net.Data does not have to regenerate the information in the cache. Each cache is managed by the Cache Manager, which can be responsible for multiple caches and can server multiple instances of Net.Data.

cache ID
A string that identifies a particular cache.

Cache Manager
The program that manages caching for one machine. It can manage multiple caches.

Cache Manager configuration file
The file containing the settings used by Net.Data to determine settings for logging, tracing, cache size, and other options. It contains settings for a Cache Manager and all the cache files managed by a particular Cache Manager. The file name is cachemgr.cnf when packaged with Net.Data.

Net.Data Caching Concepts

Depending on how many HTTP servers you have on your system, and whether each HTTP server runs its own copy of Net.Data (using separate Net.Data configuration files), you can have all the copies of Net.Data be associated with one Cache Manager or multiple Cache Managers. One Cache Manager can support a number of caches in memory, each cache has a cache identifier called a cache ID. Figure 27 shows one Cache Manager working with multiple macros and managing two caches.

Figure 27. Cache Manager Works with Multiple macros and Caches


Figure dtwa1110 not displayed.

Any number of items, known as cached pages, can be placed in a cache. Each cached page has a unique identifier, for example a Uniform Resource Locator (URL). A page is a segment of or a complete HTML page.

When Net.Data receives a request for cached data (for example, from the built-in function DTW_CACHE_PAGE), the following steps are taken:

  1. Net.Data connects to the Cache Manager.
  2. Net.Data checks to see if the data is cached.
  3. Net.Data disconnects from the Cache Manager

The Cache Manager caches HTML output when the macro successfully completes processing, ensuring that only successfully generated Web pages are cached. The data is not cached until after it has been sent to the browser, and the data that the user sees is the same data that is cached.

When Net.Data encounters an error or exits prematurely from the macro, the Cache Manager:


[ Top of Page | Previous Page | Next Page | Index ]