From: Roy T. Fielding Date: Sun, 9 Feb 1997 08:48:00 +0000 (+0000) Subject: Add documentation for mod_expires. X-Git-Tag: APACHE_1_2b7~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ec51a15b114d28d2ca87b0059f72ca92d2b97ab8;p=apache Add documentation for mod_expires. Submitted by: Ken "Rodent of Unusual Size" Coar git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@77581 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_expires.html b/docs/manual/mod/mod_expires.html new file mode 100644 index 0000000000..4dbab5f246 --- /dev/null +++ b/docs/manual/mod/mod_expires.html @@ -0,0 +1,178 @@ + + + + Apache module mod_expires + + + +

Module mod_expires

+

+ This module is contained in the mod_expires.c file, and + is not compiled in by default. It provides for the + generation of Expires headers according to user-specified + criteria. +

+

Summary

+

+ This module controls the setting of the Expires HTTP + header in server responses. The expiration date can set to be + relative to either the time the source file was last modified, or to + the time of the client access. +

+

+ The Expires HTTP header is an instruction to the client + about the document's validity and persistence. If cached, the document + may be fetched from the cache rather than from the source until this + time has passed. After that, the cache copy is considered + "expired" and invalid, and a new copy must be obtained from + the source. +

+

Directives

+

+

+
  • ExpiresActive +
  • +
  • ExpiresByType +
  • +
  • ExpiresDefault +
  • +
    +
    + +

    ExpiresActive directive

    +
    + +

    + Syntax: ExpiresActive boolean +
    + Context: server config, virtual host, directory, .htaccess +
    + Override: Indexes +
    + Status: Extension +
    + Module: mod_expires +

    +

    + This directive enables or disables the generation of the + Expires header for the document realm in question. (That + is, if found in an .htaccess file, for instance, it + applies only to documents generated from that directory.) If set to + Off, no Expires header will be + generated for any document in the realm (unless overridden at a lower + level, such as an .htaccess file overriding a server + config file). If set to On, the header will be + added to served documents according to the criteria defined by the + ExpiresByType + and + ExpiresDefault + directives (q.v.). +

    +

    + Note that this directive does not guarantee that an + Expires header will be generated. If the criteria aren't + met, no header will be sent, and the effect will be as though this + directive wasn't even specified. +

    +
    + +

    ExpiresByType directive

    +
    + +

    + Syntax: ExpiresByType mime-type <code>seconds +
    + Context: server config, virtual host, directory, .htaccess +
    + Override: Indexes +
    + Status: Extension +
    + Module: mod_expires +

    +

    + This directive defines the value of the Expires header + generated for documents of the specified type (e.g., + text/html). The second argument sets the number of + seconds that will be added to a base time to construct the expiration + date. +

    +

    + 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 <code> field; + M means that the file's last modification time should + be used as the base time, and A means the client's + access time should be used. +

    +

    + 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 ExpiresActive + On has been specified. It overrides, for the specified MIME + type only, any expiration date set by the + ExpiresDefault + directive. +

    +
    + +

    ExpiresDefault directive

    +
    + +

    + Syntax: ExpiresDefault <code>seconds +
    + Context: server config, virtual host, directory, .htaccess +
    + Override: Indexes +
    + Status: Extension +
    + Module: mod_expires +

    +

    + 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. +

    + + +