Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using Google Page Speed on my website in IIS7 and I was wondering how to set

Leverage browser caching - The following resources are missing a cache expiration
Leverage proxy caching - Consider adding a "Cache-Control: public" header to the following resources.

I am using doDynamicCompression in my web.config and little confused how to set these ? Hoping for some help

Note: Reference being used http://www.iis.net/ConfigReference/system.webServer/httpCompression

share|improve this question

2 Answers 2

I found in a few of my tests, I didn't have to do the httpCompression options, just the urlCompression tags.

<configuration>
  <system.webServer>
    <urlCompression doDynamicCompression="true" />
  </system.webServer>
</configuration>

You can achieve the same by going through the UI, and setting the option there, and it'll write the above to your web.config for you. This is under Site\Compression "Enable dynamic content compression" (Static option is usually enabled by default).

The same applies for client caching, but IIS appears to only apply this to static content. This is under Site\HTTP Response Headers\Set Common Headers, and you can enable the web content expiration there. Or the web.config version:

<system.webServer>
  <staticContent>
    <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
  </staticContent>
</system.webServer>

This sets it for 7 days. When combined, Google's Page Speed FireFox plugin it stops complaining about compression, and browser caching.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.