For the purposes of CDN invalidation I need to add a prefix to the path element of a site's URL. This is changed whenever a new version of the asset is released.
The URL is then rewritten using mod_rewrite from: http://example.com/cdn/20111030/images/image.jpg to http://example.com/images/image.jpg which is where the asset actually resides.
I would like to add long expiry headers (at least 3 months) to the response (for the first URL which doesn't actually exist in the filesystem). Does anyone know how to do this?
From http://drupal.org/node/974350#comment-5305368
These rules are for 480 weeks but you can adjust the time accordingly.
Also see the AdvAgg rules as these handle servers that do not have mod_headers or mod_expires installed. It uses a FilesMatch directive; advagg files have a fairly unique filename, thus I can do this. The AdvAgg fallbacks wont work in this case because mod_expires can't use environmental variables; neither can FileETag. From what I can see, mod_headers is the desired way to set far future times in apache.