1

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

3 Answers 3

1

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.

-2

To enable leverage browser caching in ISS server you have to follow these instruction:

1) Login your host
2) Find Web.config
3) Open web.config
4) Add cacheControlMode given bellow
5) Save web.config and check for caching.

<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseExpires" httpExpires="Tue,19 Jan 2038 03:14:07 GMT"/>
</staticContent>
</system.webServer>
</configuration>

1
  • 2
    Hello there - thank you for your contribution to Server Fault. Please be careful with self-promotion as it's seen as unwanted spam by the community. Linking to your site is fine as long as 1) you provide content here and 2) you disclose your affiliation with the site.
    – EEAA
    Aug 3, 2016 at 18:08

You must log in to answer this question.