Hitachi

uCosminexus Application Server HTTP Server User Guide


4.11.2 How to set directives

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

Organization of this subsection

(1) 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.

(2) 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 a MIME type in the ExpiresByType directive, you must define the relationship between the file name extension and the content type (MIME type) in the file (default value: conf/mimetypes file) specified in the TypesConfig directive. Alternatively, you must define that relationship in the AddType directive.

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.