4.11 Functionality to set expiry date

When you set the expiry date in the Web server contents, the client and the proxy server supporting the cache functionality do not access the Web server during that period and access their own cache, and hence this functionality is effective.

You can use expiry date setting functionality by embedding the mod_expires module in Cosminexus HTTP Server. You can use the expiry date setting functionality to execute the following operations:

The client and the proxy server handle the set Expires header and the Cache-Control header.

Organization of this section
(1) Embedding the mod_expires module
(2) How to set directives
(3) Notes

(1) Embedding the mod_expires module

You need to embed the mod_expires module to use the expiry date setting functionality. Set the following directive in configuration file (httpsd.conf) to embed the mod_expires module:

(2) How to set directives

The following are examples of setting the directive to use the expiry date setting functionality:

(a) Setting the default expiry date

Set the default expiry date using the ExpiresDefault directive for all contents on the Web server. Set the expiry date on the basis of file update time or the time when client accessed.

If you set the following, the Expires header and the Cache-Control header are added to the response by considering the validity period as the time after 60 seconds from the client access time:

ExpiresActive On
ExpiresDefault A60

"A" specified in the ExpiresDefault denotes that the client access time is the standard time.

(b) Setting the expiry date for each MIME

Set the expiry date for each MIME type with the ExpiresByType directive. The default expiry date set by the ExpiresDefault directive is overwritten for each MIME type by these settings. Set the expiry date on the basis of file update time or the time when client accessed.

If you specify the following, the Expires header and the Cache-Control header are added to the response by considering the validity period as the time after one hour from the file update time, only when the MIME type is text/html:

ExpiresActive On
ExpiresByType text/html M3600

"M" specified in the ExpiresByType denotes that the file update time is the standard time.

(3) Notes