I've got a redirect in Apache config like

Redirect temp /foo.xml http://www.baz.com/foo.xml

I'm attempting to add an Expire and m-cache headers for any CDN for this 302. This is trivial in php, but I have to do that in Apache config files.

Normally this is accomplished such as this:

ExpiresActive On ExpiresDefault "access plus ten minutesInch

but this only appears not to work with 302 redirects. Any suggestions?

Browse the mod_headers module for Apache.

Possibly something similar to:

<Location /foo.xml>
   Redirect temp /foo.xml http://www.baz.com/foo.xml
   Header set ExpiresActive On
   Header set ExpiresDefault "access plus 10 minutes"
</Location>
<Location /foo.xml>
   Redirect temp /foo.xml http://www.baz.com/foo.xml
   Header **always** set ExpiresActive On
   Header **always** set ExpiresDefault "access plus 10 minutes"
</Location>

to have it working despite HTTP 302 reactions (really, with any HTTP response) with no keyword "always", the directive "Header set" works just with success reactions, i.e. HTTP 2xx reactions.