I’m using Azure and IIS 7.5 to serve my web app, I’m not using .NET though.
I’m trying to override the default cache-control value for my static files but it seems that IIS 7.5 adds no-cache no matter what I specify.
My approot/web.config file looks like this:
<?xml version="1.0"?>
<configuration>
<system.webServer>
...
<staticContent>
<clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" />
</staticContent>
...
</system.webServer>
</configuration>
and my response headers are:
Accept-Ranges:bytes
Access-Control-Allow-Origin:*
Cache-Control:no-cache,public,max-age=2592000
Content-Encoding:gzip
Content-Length:4309
Content-Type:application/x-javascript
Date:Mon, 10 Sep 2012 14:42:07 GMT
ETag:"8ccd2f95a8fcd1:0"
Last-Modified:Mon, 10 Sep 2012 13:48:36 GMT
Server:Microsoft-IIS/7.5
Vary:Accept-Encoding
X-Powered-By:ASP.NET
I do have an extra web.config file in one of the subfolders but that doesn’t override any clientCache values.
Does anyone know why IIS is prepending no-cache?
Thanks!
Apparently, the output cache needs a location attribute otherwise it will override the staticContent/clientCache setting.