mod_expires.html revision eaa0f6c544aeefbb25223966808dcbd15d301687
03831d35f7499c87d51205817c93e9a8d42c4baestevel<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
03831d35f7499c87d51205817c93e9a8d42c4baestevel <!-- Background white, links blue (unvisited), navy (visited), red (active) -->
03831d35f7499c87d51205817c93e9a8d42c4baestevel BGCOLOR="#FFFFFF"
03831d35f7499c87d51205817c93e9a8d42c4baestevel TEXT="#000000"
03831d35f7499c87d51205817c93e9a8d42c4baestevel LINK="#0000FF"
03831d35f7499c87d51205817c93e9a8d42c4baestevel VLINK="#000080"
03831d35f7499c87d51205817c93e9a8d42c4baestevel ALINK="#FF0000"
03831d35f7499c87d51205817c93e9a8d42c4baestevel <!--#include virtual="header.html" -->
03831d35f7499c87d51205817c93e9a8d42c4baestevel This module is contained in the <CODE>mod_expires.c</CODE> file, and
03831d35f7499c87d51205817c93e9a8d42c4baestevel is <STRONG>not</STRONG> compiled in by default. It provides for the
03831d35f7499c87d51205817c93e9a8d42c4baestevel generation of <CODE>Expires</CODE> headers according to user-specified
03831d35f7499c87d51205817c93e9a8d42c4baestevel This module controls the setting of the <CODE>Expires</CODE> HTTP
03831d35f7499c87d51205817c93e9a8d42c4baestevel header in server responses. The expiration date can set to be
03831d35f7499c87d51205817c93e9a8d42c4baestevel relative to either the time the source file was last modified, or to
03831d35f7499c87d51205817c93e9a8d42c4baestevel the time of the client access.
03831d35f7499c87d51205817c93e9a8d42c4baestevel The <CODE>Expires</CODE> HTTP header is an instruction to the client
03831d35f7499c87d51205817c93e9a8d42c4baestevel about the document's validity and persistence. If cached, the document
03831d35f7499c87d51205817c93e9a8d42c4baestevel may be fetched from the cache rather than from the source until this
03831d35f7499c87d51205817c93e9a8d42c4baestevel time has passed. After that, the cache copy is considered
03831d35f7499c87d51205817c93e9a8d42c4baestevel "expired" and invalid, and a new copy must be obtained from
03831d35f7499c87d51205817c93e9a8d42c4baestevel the source.
03831d35f7499c87d51205817c93e9a8d42c4baestevel HREF="#expiresactive"
03831d35f7499c87d51205817c93e9a8d42c4baestevel >ExpiresActive</A>
03831d35f7499c87d51205817c93e9a8d42c4baestevel HREF="#expiresbytype"
03831d35f7499c87d51205817c93e9a8d42c4baestevel >ExpiresByType</A>
03831d35f7499c87d51205817c93e9a8d42c4baestevel HREF="#expiresdefault"
03831d35f7499c87d51205817c93e9a8d42c4baestevel >ExpiresDefault</A>
03831d35f7499c87d51205817c93e9a8d42c4baestevel ExpiresActive directive
03831d35f7499c87d51205817c93e9a8d42c4baestevel <!--%plaintext <?INDEX {\tt ExpiresActive} directive> -->
03831d35f7499c87d51205817c93e9a8d42c4baestevel <STRONG>Syntax:</STRONG> ExpiresActive <EM>boolean</EM>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <STRONG>Context:</STRONG> server config, virtual host, directory, .htaccess
03831d35f7499c87d51205817c93e9a8d42c4baestevel This directive enables or disables the generation of the
03831d35f7499c87d51205817c93e9a8d42c4baestevel <CODE>Expires</CODE> header for the document realm in question. (That
03831d35f7499c87d51205817c93e9a8d42c4baestevel is, if found in an <CODE>.htaccess</CODE> file, for instance, it
03831d35f7499c87d51205817c93e9a8d42c4baestevel applies only to documents generated from that directory.) If set to
03831d35f7499c87d51205817c93e9a8d42c4baestevel <EM><CODE>Off</CODE></EM>, no <CODE>Expires</CODE> header will be
03831d35f7499c87d51205817c93e9a8d42c4baestevel generated for any document in the realm (unless overridden at a lower
03831d35f7499c87d51205817c93e9a8d42c4baestevel level, such as an <CODE>.htaccess</CODE> file overriding a server
03831d35f7499c87d51205817c93e9a8d42c4baestevel config file). If set to <EM><CODE>On</CODE></EM>, the header will be
03831d35f7499c87d51205817c93e9a8d42c4baestevel added to served documents according to the criteria defined by the
03831d35f7499c87d51205817c93e9a8d42c4baestevel HREF="#expiresbytype"
03831d35f7499c87d51205817c93e9a8d42c4baestevel >ExpiresByType</A>
03831d35f7499c87d51205817c93e9a8d42c4baestevel HREF="#expiresdefault"
03831d35f7499c87d51205817c93e9a8d42c4baestevel >ExpiresDefault</A>
03831d35f7499c87d51205817c93e9a8d42c4baestevel Note that this directive does not guarantee that an
03831d35f7499c87d51205817c93e9a8d42c4baestevel <CODE>Expires</CODE> header will be generated. If the criteria aren't
03831d35f7499c87d51205817c93e9a8d42c4baestevel met, no header will be sent, and the effect will be as though this
03831d35f7499c87d51205817c93e9a8d42c4baestevel directive wasn't even specified.
03831d35f7499c87d51205817c93e9a8d42c4baestevel ExpiresByType directive
03831d35f7499c87d51205817c93e9a8d42c4baestevel <!--%plaintext <?INDEX {\tt ExpiresByType} directive> -->
03831d35f7499c87d51205817c93e9a8d42c4baestevel <STRONG>Syntax:</STRONG> ExpiresByType <EM>mime-type <code>seconds</EM>
03831d35f7499c87d51205817c93e9a8d42c4baestevel <STRONG>Context:</STRONG> server config, virtual host, directory, .htaccess
03831d35f7499c87d51205817c93e9a8d42c4baestevel This directive defines the value of the <CODE>Expires</CODE> header
03831d35f7499c87d51205817c93e9a8d42c4baestevel generated for documents of the specified type (<EM>e.g.</EM>,
24fe0b3bf671e123467ce1df0b67cadd3614c8e4jmcp <CODE>text/html</CODE>). The second argument sets the number of
03831d35f7499c87d51205817c93e9a8d42c4baestevel seconds that will be added to a base time to construct the expiration
03831d35f7499c87d51205817c93e9a8d42c4baestevel The base time is either the last modification time of the file, or the
03831d35f7499c87d51205817c93e9a8d42c4baestevel time of the client's access to the document. Which should be used is
03831d35f7499c87d51205817c93e9a8d42c4baestevel specified by the <CODE><EM><code></EM></CODE> field;
03831d35f7499c87d51205817c93e9a8d42c4baestevel <STRONG>M</STRONG> means that the file's last modification time should
03831d35f7499c87d51205817c93e9a8d42c4baestevel be used as the base time, and <STRONG>A</STRONG> means the client's
03831d35f7499c87d51205817c93e9a8d42c4baestevel access time should be used.
<!--#include virtual="footer.html" -->