Static Page Caching

You can configure EAServer to cache HTML and other static pages, which improves the speed at which the page contents are served. When a client requests an HTML page, EAServer checks the cache for a suitable entry. If the cache entry exists, the cached page is sent to the client. If the cache entry is not found, EAServer loads the page from disk, sends it to the client, then saves the page contents in the cache. Table 3-8 describes the static page caching options.

To cache dynamic content such as JSP or servlet responses, use one of the other caching options described in Chapter 5, “Web Application Tuning,” in the EAServer Performance and Tuning Guide.

Table 3-8: Static page caching properties

Property

Description

Default value

Comments/example

Enable Page Caching

Select to enable page caching.

Enabled

Enable Server Log Debug Messages

Select to log cache-related messages in the server log file, server_name.log.

Disabled

Cache Size

The maximum size of the cache, specified in bytes, kilobytes, or megabytes, which you set using an integer plus “B”, “K”, or “M”.

10M

You can specify the size using uppercase or lowercase letters; for example, to set the cache size to 20 megabytes, you can enter either 20M or 20m.

Cache Timeout

The maximum number of seconds an entry remains valid in the cache.

600 seconds (10 minutes)

To allow entries to remain valid in the cache for 30 minutes, enter 1800.

Exclude Web Application Files

A comma-delimited string that specifies the Web application files to exclude from caching. Enter the string in this form; items in brackets are optional:

(<WebAppName>[/<dir>], 
[<file_type>], [<file_type>], ...),
(<WebAppName>[/dir>], ...), ...

An empty string

To exclude all the GIF and JPG files in the images directory and all the files in the archives directory for the Web application “Vacation”, enter:

(Vacation/images, 
 *.gif, *.jpg),
(Vacation/archives, *.*)

To exclude all the files in the Vacation Web application, enter:

(Vacation)

Exclude Files

A comma-delimited string that specifies the non-Web application files to exclude from caching. Enter the file definitions in this form, relative to the document root directory:

(<dir>, [<file_type>], [<file_type>],
...), (<dir>, [<file_type>], ...), ...

NoteBy default, the document root directory is $JAGUAR/html. You can change it on the HTTP Config tab—see “HTTP Config”.

An empty string

To exclude all the files in the $JAGUAR/html/images directory, enter:

(images, *.*)

To exclude all the files in the $JAGUAR/html/images directory and all the files in its subdirectories, enter:

(images)

Flush Cache

Select to flush all the entries from the cache.

N/A

You can also flush the cache programmatically by calling the Management interface method flushStaticPageCache, which requires one string parameter. Currently, you must pass an empty string. In the future, multiple caches will require that you specify the cache name.

When you modify static page cache properties, you must refresh the cache for the changes to take effect. To refresh the cache, highlight the server icon and select File | Refresh Static Cache.