I guess that depends on what you want to achieve.

The Expires header indicates the time at which the resource expires. This means 
that until the expiry date, a cache may serve the resource without revalidating 
it, i.e. sending a conditional request to ask if there would happen to be a 
newer version available. That allows you to force a revalidation of the 
resource ever so often.

During the revalidation, if the resource in cache is fresh, the server will 
reply with a HTTP 304 "Not Modified".

Assume now that you have a response with a Last-Modified and an E-Tag, but no 
Expires or max-age. How often will the client do conditional requests to verify 
whether there is a newer version available? My guess is that it will apply 
heuristic expiration, which is pretty much up to each client implementation, 
i.e. undefined. That means you will never know how long it will take from the 
time you change the image until the image has actually been loaded by a client.

Not only that but heuristic expiration is a function of the age of the resource 
(depends on Last-Modified). In the beginning it will expire frequently, and 
then progressively less frequently.

Expires and max-age allow you to force revalidation at regular, known 
intervals. You original questions was:

>Can I add a cache-invalidation header for .jpg files modified in the past 120 
>seconds? 

AFAIK that can only be achieved by forcing revalidation after 120 seconds...

-ascs
 
-----Message d'origine-----
De : Jergen Dutch [mailto:[EMAIL PROTECTED] 
Envoyé : mardi 11 décembre 2007 14:00
À : users@httpd.apache.org
Objet : Re: [EMAIL PROTECTED] Intelligent/automatic cache expiry based on mtime

On Dec 7, 2007 2:29 PM, Axel-Stephane  SMORGRAV <[EMAIL PROTECTED]> wrote:
> ExpiresByType image/jpeg "modification plus 120 seconds"

This will expire images which have not changed.
I will stiick with etags.

Thanks.


---------------------------------------------------------------------
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: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to