|
Apache HTTP Server Version 1.3Module mod_expires
This module is contained in the Summary
This module controls the setting of the
The Directives
ExpiresActive directive
Syntax: ExpiresActive boolean
This directive enables or disables the generation of the
Note that this directive does not guarantee that an
ExpiresByType directive
Syntax: 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 directive
Syntax: 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. Alternate 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:
Apache HTTP Server Version 1.3 |
|||||||||||||||||
With any suggestions or questions please feel free to contact us |