|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
vlink="#000080" alink="#FF0000">
Apache HTTP Server Version 1.3Module mod_expiresThis module provides for the generation of
Status: Extension SummaryThis module controls the setting of the The DirectivesAlternate Interval SyntaxThe ExpiresDefault and ExpiresByType directives can also be defined in a more readable syntax of the form:
where <base> is one of:
The 'plus' keyword is optional. <num> should be an integer value [acceptable to atoi()], and <type> is one of:
For example, any of the following directives can be used to make documents expire 1 month after being accessed, by default:
The expiry time can be fine-tuned by adding several '<num> <type>' clauses:
Note that if you use a modification date based setting, the Expires header will not be added to content that does not come from a file on disk. This is due to the fact that there is no modification time for such content. ExpiresActive directiveSyntax: ExpiresActive
on|off This directive enables or disables the generation of the
Note that this directive does not guarantee that an
ExpiresByType directiveSyntax: ExpiresByType
mime-type <code>seconds This directive defines the value of the The base time is either the last modification time of the
file, or the time of the client's access to the document. Which
should be used is specified by the
The difference in effect is subtle. If M is used, all current copies of the document in all caches will expire at the same time, which can be good for something like a weekly notice that's always found at the same URL. If A is used, the date of expiration is different for each client; this can be good for image files that don't change very often, particularly for a set of related documents that all refer to the same images (i.e., the images will be accessed repeatedly within a relatively short timespan). Example: ExpiresActive On # enable expirations ExpiresByType image/gif A2592000 # expire GIF images after a month # in the client's cache ExpiresByType text/html M604800 # HTML documents are good for a # week from the time they were # changed, period Note that this directive only has effect if
You can also specify the expiration time calculation using an alternate syntax, described later in this document. ExpiresDefault directiveSyntax: ExpiresDefault
<code>seconds This directive sets the default algorithm for calculating the expiration time for all documents in the affected realm. It can be overridden on a type-by-type basis by the ExpiresByType directive. See the description of that directive for details about the syntax of the argument, and the alternate syntax description as well. Apache HTTP Server Version 1.3 |