httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Jeffrey Friedl)
Subject PATCH 19824 -- enhancement to mod_expires
Date Sun, 01 Apr 2007 05:37:39 GMT

I've submitted a small patch that enhances mod_expires to allow older files
to be given a different expires cookie than newer files.

The common case where this is useful is to give image/js/css files older
than a few hours/days a long expires time so that they're cached, while
giving a very short or nonexistent expires time to just-written files so
that they may continue to be tweaked. Once the tweaking settles down and
the file remains unchanged long enough, it gets the long expire time.

This patch manifests itself in the configuration file by extending the
timespan arguments of ExpiresByType and ExpiresDefault to allow the form

   aged <timespan> then <timespan> [else <timespan>]

For example, currently (prior to this patch), one might use

   ExpiresByType image/jpeg "10 years"

so that images are cached essentially forever, but this means that they can
not reasonably be updated in place. However, with this patch, you might use

   ExpiresByType image/jpeg "aged 2 days  THEN  10 years  ELSE  1 hour"

to allow for some initial tweaking.

Is there any chance that a change like this could be accepted?

Jeffrey Friedl           Kyoto, Japan    

View raw message