My IIS7 web.config is set to the following with a folder of static assets (not within an ASP.NET app or anything):
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="500.00:00:00" />
</staticContent>
<httpProtocol allowKeepAlive="false" />
</system.webServer>
</configuration>
When I try to access a Silverlight .XAP file, I expect IIS to tell the browser that it can be cached for 500 days.
However, this is the cache header:
Cache-Control: no-cache,public,max-age=43200000
Why is IIS still adding no-cache
to this header with the above configuration file?
You need to configure IIS to treat XAP as static content. Try this: