httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "PINNI, BALANAND \(SBCSI\)" <bp3...@sbc.com>
Subject RE: [users@httpd] mod_expire
Date Thu, 23 Sep 2004 17:53:49 GMT
Thanks Joshu

How to set THIS DIRECTIVE FOR 24 Hrs.

How is he getting A2592000 value for a month?
# expire GIF images after a month in the client's cache
ExpiresByType image/gif A2592000
# HTML documents are good for a week from the
# time they were changed
ExpiresByType text/html M604800 


ExpiresByType Directive
Description: Value of the Expires header configured by MIME type 
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 and the max-age
directive of the Cache-Control 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 Cache-Control: max-age is calculated by subtracting the
request time from the expiration date and expressing the result in
seconds.

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:
# enable expirations
ExpiresActive On
# expire GIF images after a month in the client's cache
ExpiresByType image/gif A2592000
# HTML documents are good for a week from the
# time they were changed
ExpiresByType text/html M604800 
 24HRS:


-----Original Message-----
From: Joshua Slive [mailto:jslive@gmail.com] 
Sent: Thursday, September 23, 2004 12:40 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] mod_expire


On Thu, 23 Sep 2004 11:55:13 -0500, PINNI, BALANAND (SBCSI)
<bp3965@sbc.com> wrote:
> Dear Gurus,
> 
> Can anyone give me direction as to how to use this directives? I need
> for 24Hrs.
> Details about it can be found at:
> http://httpd.apache.org/docs-2.1/mod/mod_expires.html
> Else please help me if anyone of you have set this in your
> configuration.

Sure, lots of people use this.  What exactly is your question?  What
is it about the documentation that you don't understand?

Here's an example:
ExpiresActive On
ExpiresDefault "access plus 24 hours"

> Also, should the cache be enabled in httpd.conf?

No, mod_cache is independent of mod_expires.  They do completely
different things.  One tells the clients how long to cache for, the
other does caching at the server level.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message