I am trying to develop a "semi-permanent" redirect in IIS 8.5 using a 301 response along with cache expiration header(s), perhaps a max-age or cache-control with a reasonable expiration. However IIS's URL Rewrite doesn't seem to support adding response headers to a redirect rule. I see how to affect the cache at a larger scope, like this, but not how to apply them to individual redirects. I.e.:
<rule name="foo" stopProcessing="true">
<match url="foo" />
<conditions>
<add input="{URL}" pattern="/foo($|\/$)" />
</conditions>
<action type="Redirect" url="http://domain.com/full_url_for_now" redirectType="Permanent" someParameterThatLetsMeSetResponseHeaders="max-age:3600"/>
</rule>
Thanks for any advice. I'm guessing there's some other way to do this for individual rules/paths/etc., but no luck finding it. If it's not possible, then I'll have to set the cache parameters at a higher level.
Why: the redirect is for a vanity URL; the path will be the same for a month or two but may change after that. Straight 301 will cache permanently in some browsers. 302/307 will cause the the vanity URL to be indexed, which would mess up my SEO.