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.
Created attachment 19824 [details] Patch to implement the mod_expires enhancement
no new features in 1.3