Bug 41963 - PATCH: Enhancement to mod_expires to allow "expire in X seconds if file is at least Y seconds old"
Summary: PATCH: Enhancement to mod_expires to allow "expire in X seconds if file is at...
Status: RESOLVED WONTFIX
Alias: None
Product: Apache httpd-1.3
Classification: Unclassified
Component: Other mods (show other bugs)
Version: HEAD
Hardware: All other
: P5 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2007-03-27 23:55 UTC by Jeffrey Friedl
Modified: 2007-08-02 13:16 UTC (History)
0 users



Attachments
Patch to implement the mod_expires enhancement (6.18 KB, patch)
2007-03-27 23:56 UTC, Jeffrey Friedl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey Friedl 2007-03-27 23:55:25 UTC
Some shy away from setting an expire time on images because they often update
images in place, particularly recently-created images. This addition to
mod_expire addresses the latter case, allowing one to set different expire times
depending on whether the file being served is/isn't older than some set threshold.

For example, to set the expire time far into the future for JPG files that are
more than a week old:

   ExpiresByType image/jpeg "aged 1 week then 10 years"

This leaves JPG images less than a week old without an expire tag, and ones a
week old or older with one 10 years in the distance (from the access time).

It also supports an "else" clause:

  ExpireByType image/jpeg "aged 1 week then 10 years else 1 hour"

The patch does not include the documentation -- I wanted to gauge the reaction,
first.

This small patch can go a long way toward allowing web sites to get the benefits
of image caching, while still allowing a window for in-place updates. This can
also be useful for CSS and JS, in conjunction with filename versioning.
Comment 1 Jeffrey Friedl 2007-03-27 23:56:38 UTC
Created attachment 19824 [details]
Patch to implement the mod_expires enhancement
Comment 2 Jim Jagielski 2007-08-02 13:16:09 UTC
no new features in 1.3