Module mod_as_cache

Important: Information for this topic supports the latest PTF levels for HTTP Server for i5/OS . It is recommended that you install the latest PTFs to upgrade to the latest level of the HTTP Server for i5/OS. Some of the topics documented here are not available prior to this update. See http://www.ibm.com/servers/eserver/iseries/software/http/services/service.htm Link outside Information Center for more information.

Summary

The module mod_as_cache provides support for caching frequently referenced files. It can be used to cache file content, file descriptors or both, or mmap the file.

Directives

CacheLocalFD

Module: mod_as_cache
Syntax: CacheLocalFD filename
Default: none
Context: server config
Override: none
Origin: iSeries™
Example: CacheLocalFD some_image.gif

The CacheLocalFD directive is used to specify the names of ASCII/BINARY stream files whose descriptors you want to cache at server startup. The file is opened (share read) and remains open while the server is active. The configuration file can contain multiple directive occurrences. Include a separate directive for each file that you want to remain open. By keeping your most frequently requested files/images opened at server startup, you can improve your server's response time for those files. For example, if you open your server's welcome page files at startup, the server can handle requests for the page much more quickly than if it had to open the files each time they are requested.

Parameter: filename
  • The filename parameter specifies the names of ASCII/BINARY stream files whose descriptors are cached at server startup.

The advantage of using CacheLocalFD directive over CacheLocalFile is that it does not cache the content of the file, and therefore does not allocate a large amount of memory, yet provides similar performance. The disadvantage of using CacheLocalFD directive over CacheLocalFile is that it only caches the file descriptors of ASCII/BINARY stream files and it keeps the file open (share read) while the server is active.

The LiveLocalCache directive setting does not apply to this directive and if a cached file is updated, the cached entity is discarded and the updated file is served from the file system. If a cached file is modified while at the same time being served, the content of the response body is unpredictable.

Note: You can use an asterisk ('*') as a wildcard character on the file names (for example, CacheLocalFD *.gif). File name matching is not recursive through subdirectories. The server will only cache files in the specified directory. No files in subdirectories are affected.

CacheLocalFile

Module: mod_as_cache
Syntax: CacheLocalFile filename
Default: none
Context: server config
Override: none
Origin: iSeries
Example: CacheLocalFile bobwelcome.html

The CacheLocalFile directive is used to specify the names of files that you want to load into the server's memory each time that you start the server, and is the recommended file cache method. You can have multiple occurrences of this directive in the configuration file. Include a separate directive for each file that you want to load into memory. By keeping your most frequently requested files loaded in the server's memory, you can improve your server's response time for those files. For example, if you load your server's welcome page into memory at startup, the server can handle requests for the page much more quickly than if it had to read the file from the file system.

Parameter: filename
  • The filename parameter specifies the names of files that you want to load into the server's memory each time that you start the server.
Note: You can use an asterisk ('*') as a wildcard character on the file names (for example, CacheLocalFile *.html). File name matching is not recursive through subdirectories. The server will only cache files in the specified directory. No files in subdirectories are affected.

CacheLocalFileMmap

Module: mod_as_cache
Syntax: CacheLocalFileMmap filename
Default: none
Context: server config
Override: none
Origin: iSeries
Example: CacheLocalFileMmap bobwelcome.html

The CacheLocalFileMmap directive is used to specify the names of files that you want to map to the server's memory each time that you start the server. This directive is similar to the CacheLocalFile directive. Whereas CacheLocalFile allocates storage and copies (read/write) the content of the file to the allocated storage, CacheLocalFileMmap maps the file content to the process storage space without actually allocating storage.

The LiveLocalCache directive setting does not apply to this directive and if a cached file is updated, the cached entity is discarded and the updated file is served from the file system. If a cached file is modified while at the same time being served, the content of the response body is unpredictable.

Parameter: filename
  • The filename parameter specifies the names of files that you want to map to the server's memory each time that you start the server.

You can have multiple occurrences of this directive in the configuration file. Include a separate directive for each file that you want to load into memory. By keeping your most frequently requested files mapped in the server's address space, you can improve your server's response time for those files. For example, if you map your server's welcome at startup, the server can handle requests for the page much more quickly than if it had to read the file from the file system.

Note: You can use an asterisk (*) as a wildcard character on the file names (for example, CacheLocalFileMmap *.html). File name matching is not recursive through subdirectories. The server will only cache files in the specified directory. No files in subdirectories are affected. The relative/absolute path rules apply to this directive, meaning that a path that begins without a leading (/) character is considered to be absolute. Otherwise, the path is based on the server's document root.

CacheLocalFilePublic

Module: mod_as_cache
Syntax: CacheLocalFilePublic filename
Default: none
Context: server
Override: none
Origin: iSeries
Example: CacheLocalFilePublic bobwelcome.html

The CacheLocalFilePublic directive is used to specify the names of files that you want to load into the server's memory each time that you start the server. The files cached here are files that are served without any server authentication. This directive is used by SSL sites which have pages that are publicly available. This simulates the FRCA function completed by the server for non-SSL publicly available files. You can have multiple occurrences of this directive in the configuration file. Include a separate directive for each file that you want to load into memory. By keeping your most frequently requested public files loaded in the server's memory, you can improve your server's response time for those files. For example, if you load your server's welcome page into memory at startup, the server can handle requests for the page much more quickly than if it had to read the file from the file system.

Note: You can use an asterisk (''*'') as a wildcard character on the file names, (for example, CacheLocalFile *.html).

File name matching is not recursive through subdirectories. The server only caches files in the specified directory. No files in subdirectories are affected. There is no authentication or authorization done before any files in this cache are served.

CacheLocalFileSizeLimit

Module: mod_as_cache
Syntax: CacheLocalFileSizeLimit size
Default: CacheLocalFileSizeLimit 90000
Context: server config
Override: none
Origin: iSeries
Example: CacheLocalFileSizeLimit 5000000

The CacheLocalFileSizeLimit directive is used to specify, in bytes, the largest file that will be placed in the local memory cache. A file larger than the value specified for CacheLocalFileSizeLimit will not be placed in the cache. This prevents the cache from being filled by only a small number of very large files. The upper limit for this directive is capped at 16,000,000. If you specify a larger value the value 16,000,000 will be used.

CacheLocalSizeLimit

Module: mod_as_cache
Syntax: CacheLocalSizeLimit size
Default: CacheLocalSizeLimit 2000
Context: server config
Override: none
Origin: iSeries
Example: CacheLocalSizeLimit 25000

The CacheLocalSizeLimit directive is used to specify the maximum amount of memory, in kilobytes, that you want to allow for file caching. You must specify the files that you want cached with the CacheLocalFile directive or by setting DynamicCache to on. The number you specify is the upper limit (the maximum upper limits 93 gigabytes (100,000,000,000 bytes)); the storage is allocated as a file is cached.

Parameter: size
  • The size parameter specifies the maximum amount of memory, in kilobytes, that you want to allow for file caching.

Note: CacheLocalSizeLimit can help limit your cache size when you are using the wildcard character to specify the files on the CacheLocalFile directive.

DynamicCache

Module: mod_as_cache
Syntax: DynamicCache on | off
Default: DynamicCache off
Context: server config
Override: none
Origin: iSeries
Example: DynamicCache on

The DynamicCache directive is used to specify if you want the server to dynamically cache frequently accessed files. Setting the dynamic cache directive to "on" instructs the server to cache the most frequently accessed files. This results in better performance and system throughput.

Parameter: on | off
  • If the parameter is set to on the server will dynamically cache frequently accessed files.
  • If the parameter is set to off the server will not dynamically cache frequently accessed files.
Note: Note requires links.If you know the files that are frequently accessed or you have a large number of files, then it is better to use CacheLocalFile , CacheLocalFD, or CacheLocalFileMmap to cache them at server startup.

FRCACacheLocalFileRunTime

Module: mod_as_cache
Syntax: FRCACacheLocalFileRunTime filename
Default: none
Context: server config
Override: none
Origin: iSeries
Example: FRCACacheLocalFileRunTime /www/html/index.html

The FRCACacheLocalFileRunTime directive specifies the name of a file that you want to load into the SLIC NFC during server run time if and when it is requested by a client. The configuration file can contain multiple directive occurrences.

Parameter: filename
  • The filename parameter value specifies the name of a file that you want to load into the SLIC NFC during server run time if and when it is requested by a client.

During server run time, the below example caches the specified file in FRCA NFC if it is requested by a client.

FRCACacheLocalFileRunTime /www/html/index.html
Note: You can use an asterisk (*) as a wild card character on the file name. Filename matching is not recursive through subdirectories. The server only caches files in the specified directory. No files in other sub directories are affected.

During server run time, the below example caches in the FRCA NFC any .gif file in the /www/images directory that is requested by a client. For example,

FRCACacheLocalFileRunTime /www/images/*.gif
Note: You can use an asterisk (*) as a wild card character on the file name. Filename matching is not recursive through subdirectories. The server will only cache files in the specified directory and its subdirectories.

During server run time, the below example will dynamically cache in the SLIC NFC (based on the file usage) any file that is in a directory path that starts with /www/imag and its subdirectories. For example,

FRCACacheLocalFileRunTime /www/imag*
Note: If directory name begins with / it is absolute, otherwise it is relative to the server's document root.

During server run time, the below example will dynamically cache in the SLIC NFC (based on the file usage) any file in any directory.

FRCACacheLocalFileRunTime /*
Note: If a directory name begins with / it is absolute, otherwise it is relative to the server's document root.

For caching files at the server run time, only specify the path name of the files that are intended for public viewing. That is, do not specify or configure file names containing sensitive information which is not intended for general users. FRCACacheLocalFileRunTime only caches files that do not require conversion. (IFS binary or ASCII files).

FRCACacheLocalFileSizeLimit

Module: mod_as_cache
Syntax: FRCACacheLocalFileSizeLimit size
Default: FRCACacheLocalFileSizeLimit 92160
Context: server config
Override: none
Origin: iSeries
Example: FRCACacheLocalFileSizeLimit 32000

The FRCACacheLocalFileSizeLimit directive specifies the maximum file size (in bytes) that you want to allow for file caching. The directive can control cache storage for a number of smaller files when using wild card characters to specify files in the FRCACacheLocalFileStartUp and FRCACacheLocalFileDynamic directives

Parameter: size
  • The size parameter value specifies the maximum file size (in bytes) that you want to allow for file caching.

The below example allows only caching of files that are equal to or less than 32000 bytes. Files greater than 32000 bytes are not cached.

FRCACacheLocalFileSizeLimit 32000

FRCACacheLocalFileStartUp

Module: mod_as_cache
Syntax: FRCACacheLocalFileStartUp filename
Default: none
Context: server config
Override: none
Origin: iSeries
Example: FRCACacheLocalFileStartUp /www/html/index.html

The FRCACacheLocalFileStartUp directive specifies the file name that you want to load into the SLIC NFC each time you start the server. The configuration file can contain multiple directive occurrences.

Parameter: filename
  • The filename parameter value specifies the file name that you want to load into the SLIC NFC each time you start the server.

The below example caches a specific file.

FRCACacheLocalFileStartUp /www/html/index.html
Note: You can use an asterisk (*) as a wild card character on the file name. Filename matching is not recursive through subdirectories. The server only caches files in the specified directory. No files in other sub directories are affected.

The below example caches all .gif files in the /www/images directory.

FRCACacheLocalFileStartUp /www/images/*.gif
Note: If a directory name begins with / it is absolute, otherwise it is relative to the server's document root.

FRCACacheLocalFileStartUp only caches files that do not require conversion. (IFS binary or ASCII files). FRCA Proxy does not perform authentication or authorization checking. Therefore, do not specify or configure file names containing sensitive information that is not intended for public viewing.

FRCACacheLocalSizeLimit

Module: mod_as_cache
Syntax: FRCACacheLocalSizeLimit size
Default: FRCACacheLocalSizeLimit 2000
Context: server config
Override: none
Origin: iSeries
Example: FRCACacheLocalSizeLimit 5000

The FRCACacheLocalSizeLimit directive specifies the maximum amount of storage (in kilobytes) that you want to allow for FRCA file caching.

Parameter: size
  • The size parameter value specifies the maximum amount of storage (in kilobytes) that you want to allow for FRCA file caching.

The below example caches files until the accumulated size reaches 5000 kilobytes.

FRCACacheLocalSizeLimit 5000
Note: The specified value is the upper limit, the actual amount of allocated storage is the accumulated size of the cached files. This directive can limit the cache size when using wild card character to specify the files in the FRCACacheLocalFileStartUp directive.

If the specified directive size is greater than the amount of available storage in the FRCA network file cache, the FRCA network file only caches as many files as it has space for.

FRCACookieAware

Module: mod_as_cache
Syntax: FRCACookieAware <path>
Default: none
Context: server config
Override: none
Origin: iSeries
Example: FRCACookieAware /some_path_segment

This FRCACookieAware directive indicates URL prefix for which the cookie should be included in cache lookup. This directive makes it possible to serve a cached entity only for the requests with the same cookie

Parameter: <path>
  • The <path> parameter value specifies a valid path name.

FRCAEnableFileCache

Module: mod_as_cache
Syntax: FRCAEnableFileCache on | off
Default: FRCAEnableFileCache off
Context: server config
Override: none
Origin: iSeries
Example: FRCAEnableFileCache on

The FRCAEnableFileCache directive enables or disables FRCA file caching support for the specified server.

Parameter: on | off
  • If the parameter value is on, FRCA file caching support is enabled for the specified server.
  • If the parameter value is off, all other FRCA file cache related directives in the configuration file are ignored.
Note: FRCA does not perform authentication or authorization checking for the HTTP requests that are served from the FRCA cache.

FRCAEnableProxy

Module: mod_as_cache
Syntax: FRCAEnableProxy on | off
Default: FRCAEnableProxy off
Context: server config, virtual host
Override: none
Origin: iSeries
Example: FRCAEnableProxy on

The FRCAEnableFileCache directive enables or disables FRCA proxy support.

Parameter: on | off
  • If the parameter value is on, FRCA proxy support is enabled for the specified container.
  • If the parameter value is off, only FRCA directives in the server configuration section are ignored. If FRCAEnableProxy is set to off in a virtual host container, only FRCA directives in that virtual host container are ignored.

FRCA proxy does not perform authentication or authorization checking for the HTTP requests that are served by the FRCA Proxy support.

Note: Virtual host containers do not inherit the FRCAEnableProxy setting from the server configuration.

FRCAEndofURLMarker

Module: mod_as_cache
Syntax: FRCAEndofURLMarker <string>
Default: none
Context: server config
Override: none
Origin: iSeries
Example: FRCAEndofURLMarker ###"
Example: FRCAEndofURLMarker eou
Example: FRCAEndofURLMarker #eou#

The FRCAEndofURLMarker directive specifies the unique string that identifies the end of URLs. Suppose a link in an html page is http://some.org/some_path/some_parms###. Before the client sends this request to the server, it may pad the URL with data such as client_padded_data. The some.org server will receive the path /some_path/some_parms###client_padded_data.

By specifying FRCAEndofURLMarker ###", FRCA support can identify the end of the original URL (link) before it was modified or padded by the client.

Parameter: <string>
  • The <string> parameter value specifies a string of one or more characters including #, $.

FRCAMaxCommBufferSize

Module: mod_as_cache
Syntax: FRCAMaxCommBufferSize size
Default: FRCAMaxCommBufferSize 8000
Context: server config
Override: none
Origin: Apache
Example: FRCAMaxCommBufferSize 4000000

The FRCAMaxCommBufferSize directive sets the communication buffer size (in bytes) in FRCA for performance. The data being sent to HTTP Server (powered by Apache) consists of log data, message data, and collection services data. FRCA will buffer the size of data specified until the buffer is full. Once the buffer is full, the data will be transmitted to Apache for processing.

Parameter: size
  • The size parameter value sets the communication buffer size (in bytes) in FRCA for performance.

FRCAMaxCommTime

Module: mod_as_cache
Syntax: FRCAMaxCommTime time
Default: FRCAMaxCommTime 120
Context: server config
Override: none
Origin: Apache
Example: FRCAMaxCommTime 240

The FRCAMaxCommTime directive sets the maximum number of seconds to wait before the data buffer is sent from FRCA to HTTP Server (powered by Apache). The data being sent to HTTP Server consists of log data, message data, and collection services data. Once the time limit has been reached, the data will be transmitted to HTTP Server for processing. Valid values include integers 0 through 65,535.

Parameter: time
  • The time parameter value sets the maximum number of seconds to wait before the data buffer is sent from FRCA to HTTP Server (powered by Apache).

FRCAProxyCacheEntitySizeLimit

Module: mod_as_cache
Syntax: FRCAProxyCacheEntitySizeLimit size
Default: FRCAProxyCacheEntitySizeLimit 92160
Context: server config
Override: none
Origin: iSeries
Example: FRCAProxyCacheEntitySizeLimit 8000

The FRCAProxyCacheEntitySizeLimit directive specifies the maximum proxy response entity size (in bytes) for FRCA to cache.

Parameter: size
  • The size parameter value specifies the maximum proxy response entity size (in bytes) for FRCA to cache.

The below example only allows caching of proxy responses that are equal to, or less than, 8000 bytes.

FRCAProxyCacheEntitySizeLimit 8000

FRCAProxyCacheExpiryLimit

Module: mod_as_cache
Syntax: FRCAProxyCacheExpiryLimit <time>
Default: FRCAProxyCacheExpiryLimit 86400
Context: server config
Override: none
Origin: iSeries
Example: FRCAProxyCacheExpiryLimit 3600

The FRCAProxyCacheExpiryLimit directive sets the expiration (in seconds) for FRCA proxy cached HTTP documents. Expiry time for FRCA proxy cached HTTP documents will be set to at most nnn number of seconds into the future. FRCA proxy cached HTTP documents can be at most nnn seconds out of date. If the expire header is present with the document in the response, then the lower of the two values is used.

Parameter: <time>
  • The <time> parameter value sets the expiration (in seconds) for FRCA proxy cached HTTP documents.

FRCA proxy cached HTTP documents are limited by the specified time interval (in seconds). This restriction is enforced even if an expiration date is supplied with the HTTP document.

FRCAProxyCacheRefreshInterval

Module: mod_as_cache
Syntax: FRCAProxyCacheRefreshInterval <proxy> <time>
Default: none
Context: server config, virtual host
Override: none
Origin: iSeries
Example: FRCAProxyCacheRefreshInterval /mirror/ibm/test 30

The FRCAProxyCacehRefreshInterval directive sets the time period (in seconds) to use each cached entity, for the specified URI, before refreshing the cache.

Parameter One: <path>
  • The <path> parameter value specifies the URI associated with cached entity.
Parameter Two: <time>
  • The <time> parameter value sets the time period (in seconds) to use each cached entity, for the specified URI, before refreshing the cache. Possible values include integers 0 through 2,147,483,647.
Note: If the value specified for <time> is zero, then the document for the specified path are always current. That is the document is not cached.

FRCA proxy cached HTTP documents are limited by the specified interval (in seconds). This restriction is enforced even if an expiration date is supplied with the HTTP document.

FRCAProxyCacheSizeLimit

Module: mod_as_cache
Syntax: FRCAProxyCacheSizeLimit size
Default: FRCAProxyCacheSizeLimit 2000
Context: server config
Override: none
Origin: iSeries
Example: FRCAProxyCacheSizeLimit 5000

The FRCAProxyCacheSizeLimit directive specifies the maximum amount of storage (in kilobytes) that FRCA proxy caching uses for the specified server.

Parameter One: size
  • The size parameter value specifies the maximum amount of storage (in kilobytes) that FRCA proxy caching uses for the specified server.

The below example caches proxy response entities until the accumulated size reaches 5000 kilobytes.

FRCAProxyCacheSizeLimit 5000
Note: The specified value is the upper limit; the actual amount of allocated storage is the accumulated proxy entity cache size.

FRCAProxyPass

Module: mod_as_cache
Syntax: FRCAProxyPass <path> <URL>
Default: none
Context: server config, virtual host
Override: none
Origin: iSeries
Example: FRCAProxyPass /mirror/foo/ http://foo.com/

The FRCAProxyPass directive allows remote servers to map into the local server space. The local server does not act as a proxy in the conventional sense; it acts a mirror of the remote server.

Parameter One: <path>
  • The <path> parameter value specifies the name of a local virtual path. The value is case sensitive.
Parameter Two: <URL>
  • The <URL> parameter value specifies the partial URL for the remote server.

If the local server address is http://ibm.com/ then FRCAProxyPass /mirror/ibm1/ http://ibm1.com/ causes a local request for the http://ibm.com/mirror/ibm1/location to be internally converted into a proxy request of http://ibm1.com/location.

Note: FRCA Proxy does not perform authentication or authorization checking. Therefore, do not specify or configure paths or URLs that would result in responses with sensitive information that is not intended for public viewing.

FRCARandomizeResponse

Module: mod_as_cache
Syntax: FRCARandomizeResponse <path> <string> <nnn> <mmm>
Default: none
Context: server config
Override: none
Origin: iSeries
Example: FRCARandomizeResponse /some_path/fileNNN.html NNN 1 1000
Example: FRCARandomizeResponse /some_path/fileXXX.html XXX 200 300

The FRCARandomizeResponse directive specifies the path template, the replacement string marker, and the random number range that you would like FRCA to randomly use when selecting and serving files of that template. For example, if you have 1000 files with names file1.html through file1000.html. By configuring FRCARandomizeResponse /document_root_alias_path/fileNNN.html NNN 1 1000 and requesting the URL http://some_host:port/dirpath/fileNNN.html, FRCA will randomly select and serve one of the 1000 files.

Parameter One: <path>
  • The <path> parameter value specifies valid paths in the form of /some_path_segment/some_partial_file_name#.ext where "#" is replaced with a randomly generated number by FRCA before serving the response.
    Note: the path must begin with '/'. It cannot be a relative path.
Parameter Two: <string>
  • Text <string> parameter value specifies the replacement string marker ("NNN") in the path.
Parameter Three: <nnn>
  • The <nnn> parameter value specifies the lower limit for random numbers.
Parameter Four: <mmm>
  • The <mmm> parameter value specifies the upper limit for random numbers.

LiveLocalCache

Module: mod_as_cache
Syntax: LiveLocalCache on | off
Default: LiveLocalCache on
Context: server config
Override: none
Origin: iSeries
Example: LiveLocalCache off

The LiveLocalCache directive is used to specify if the cache is updated when a cached file is modified. Set this directive to "on" if you want users, requesting a cached file, to receive the file with the latest updates. Setting this directive to "off" is the optimum setting for performance. When LiveLocalCache directive is set to "on", before responding to a request for a file that is stored in memory, the server checks to see if the file has changed since the server was started. If the file has changed, the server responds to this request with the updated file. The server then deletes the older file version from memory. Restart the server to load the new file into memory.

Parameter: on | off
  • If the parameter value is set to on, the cache is updated when a cached file is modified.
  • If the parameter value is set to off, the cache is not updated when a cached file is modified.