IIS7 cacheControlMaxAge attribute not working

In IIS 7.5, I set cacheControlMaxAge for one year this way

<location path="Content/Images">
    <system.webServer>
      <staticContent>
        <clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
      </staticContent>
    </system.webServer>
  </location>

According to this guide: Expiration Setting and Cache Control: Maximum Age Headers for Static Resources in ASP.NET

However, the Google PageSpeed ​​tool still says the files are not cached:

The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:
* https://local.example.com/Content/Images/image1.png (expiration not specified)
(etc)

Why does he say "no expiration is indicated"?

The whole webapp is served via https, is that a factor?

+5
source share
2 answers

I solved this by changing the path specified from Content/Images, toContent

<location path="Content">
    <system.webServer>
      <staticContent>
        <clientCache cacheControlCustom="public" 
                     cacheControlMode="UseMaxAge" 
                     cacheControlMaxAge="365.00:00:00" />
      </staticContent>
    </system.webServer>
  </location>

So, it is fixed, but changing the path does not make it clear that the problem actually was.

+3
source

, Google PageSpeed ​​ , "" . , PageSpeed. Firebug Firefox net. "" .

0

All Articles