Use the following steps to configure Net.Data for caching:
Use one or more DTW_CACHE_PAGE directives to identify the Web pages that are to be cached. Specify the directives in the Net.Data configuration file.
Syntax:
DTW_CACHE_PAGE file_name_spec|path_template_spec lifetime usage_scope
Where:
You can specify this directive multiple times. Specify one DTW_CACHE_PAGE directive for each file_name_spec or path_template_spec value. If DTW_CACHE_PAGE directives conflict with each other, the first directive specified takes precedence.
A cached page is reused for a request if the URL, the form data, and the query string of the request match the URL, form data, and query string of the request that originally cached the page.
Examples:
Example 1: Specifies the caching of any Web pages generated when Net.Data executes the specified HTML block
DTW_CACHE_PAGE /u/USER1/macros/main.d2w/output 3600 PUBLIC
In this example, Net.Data caches the Web pages generated when it executes the output HTML block in the macro main.d2w, located in the /u/USER1/macros directory. The Web pages have PUBLIC scope, and remain valid for 1 hour.
Example 2: Specifies the caching of any Web pages generated when Net.Data executes any HTML block in the specified macro
DTW_CACHE_PAGE /u/USER1/macros/main.d2w/* 3600 PUBLIC
In this example, Net.Data caches any Web pages Net.Data generates when it executes any HTML block in the macro main.d2w, located in the /u/USER1/macros directory. The Web pages have PUBLIC scope, and remain valid for 1 hour.
Example 3: Specifies the caching of any Web pages generated when Net.Data executes HTML blocks in macros located in one or more directories
DTW_CACHE_PAGE /u/USER1/macros/* 3600 PUBLIC
In this example, Net.Data caches any Web pages Net.Data generates when it executes any HTML block in any macro located in the /u/USER1/macros directory or its subdirectories. The Web pages have PUBLIC scope, and remain valid for 1 hour.
Example 4: Specifies the caching of any Web page generated by all Net.Data macros
DTW_CACHE_PAGE /* 3600 PUBLIC
In this example, Net.Data caches all Web pages Net.Data generates. The Web pages have PUBLIC scope, and remain valid for 1 hour.
Example 5: Specifies multiple Web page caching directives
DTW_CACHE_PAGE /u/USER1/macros/main/* 1800 PUBLIC DTW_CACHE_PAGE /u/USER1/macros/special/daily_news.d2w/* 43200 PUBLIC DTW_CACHE_PAGE /u/USER1/macros/special/employee_stats.d2w/* 3600 PRIVATEIn this example, Net.Data caches all Web pages generated from any HTML block in any macros located in the /u/USER1/macros/main/ directory. The Web pages have PUBLIC scope and remain valid for 30 minutes. All Web pages generated by the daily_news.d2w macro in the directory /u/USER1/macros/special/ have PUBLIC scope and remain valid for 12 hours. All Web pages generated by the employee_stats.d2w macro in the directory /u/USER1/macros/special/ have PRIVATE scope and remain valid for 1 hour.
Set up the table used to cache Web pages.
In a data sharing environment, the CREATE TABLESPACE statement that creates the tablespace for SYSIBM.DTWCACHEDPAGES and SYSIBM.DTWCACHEDEPS should specify GBPCACHE CHANGED.
The JCL for this step is located in DTW220.SDTWBASE(DTWCCHBD).
After you have set up this table and stored procedure, you can begin caching Web pages.