1

I am trying to implement the advice from Google's Pagespeed concerning browser caching(Set Expirer or Cache-control headers on static content). After reading many posts here (like IIS7 Cache-Control ) and on other website I just can't seem to figure out why Pagespeed is for example still disapproving my CSS files.

For example: http://test.grotefeesten.nl/clientdata/71/js/jssor.config.js. This file has an expiration time of 1 day according to local PageSpeed but not according to the online PageSpeed test.

My web.config:

 <caching>
  <profiles>
    <add extension=".css" policy="CacheUntilChange" 
     kernelCachePolicy="CacheUntilChange" location="Any" />
  </profiles>
 </caching>
 <httpProtocol>
 <customHeaders>
   <add name="Cache-Control" value="public" />
 </customHeaders>
 </httpProtocol>
 <staticContent>
   <clientCache cacheControlMode="UseMaxAge" cacheControlCustom="max-age"
    cacheControlMaxAge="1.00:00:00" />
 </staticContent>

Does anybody see what I am missing here to set the Expires header properly?

Community
  • 1
  • 1

1 Answers1

0

I had been struggling with this myself. However, I found a solution:

<httpProtocol>
    <customHeaders>
        <add name="Cache-Control" value="max-age=2592000" />
    </customHeaders>
</httpProtocol>

This was all it took. The value in the code above, "max-age=2592000", is 1 month.

Red Shift
  • 1,312
  • 2
  • 17
  • 29