asp.net - How to set cache headers for files accessed directly -
i have server serves wav file twilio , having problems set cache files. problem files have different expiration date, shouldn't cached, should cached day, month , on. @ moment able set not cache of files using iis output caching, need set caches. twilio request wav files calling directly, example, http://mywebsite.com/mysoundwithoutcache.wav http://mywebsite.com/mysoundwith1daycache.wav , on.
my question how add headers files been called directly?
i using iis 7 , asp.net
thanks in advance
the way apply settings files use location tag, in web.config add new node under configuration:
<location path="cache_me.wav"> <system.webserver> <caching> <profiles> <add extension="*.wav" policy="cachefortimeperiod" kernelcachepolicy="dontcache" duration="01:00:00" /> </profiles> </caching> </system.webserver> </location>
unfortunately don't think can use wildcards in path attribute, 1 of these sections each file. if easier put files cached separate folder, can away single location node.
having said that, should not worry output caching waves files, static files cached iis automatically.
Comments
Post a Comment