Project

General

Profile

Actions

Content Caching

Module: mod_expire

Description

mod_expire controls the Cache-Control: max-age response header in HTTP/1.1 or later, and Expires response header in HTTP/1.0. These caching headers are useful to set for static files which should be cached aggressively like images, javascript, stylesheets, or similar.

Options

expire.url
assigns a expiration to all files below the specified path prefix. The specification of the time is made up of:
<access|modification> plus <number> <years|months|days|hours|minutes|seconds>
where access means time of user access and modification means time of file modification.
This follows the syntax used by Apache mod_expire. (https://httpd.apache.org/docs/current/mod/mod_expires.html)

Example: expire.url = ( "/images/" => "access plus 1 hours" )

Example to include all sub-directories:

    $HTTP["url"] =~ "^/images/" {
         expire.url = ( "" => "access plus 1 hours" )
    }

expire.mimetypes (since 1.4.43)
assigns a expiration to all responses with Content-Type prefix matching the listed mimetypes (prefix match).
The syntax is the same as expire.url, except using mimetypes instead of urls.
Example: expire.mimetypes = ( "text/" => "access plus 1 hours" )

Updated by gstrauss about 1 month ago · 22 revisions