6

I have this in my web.config:

<system.webServer>
      <httpProtocol>
          <customHeaders>
              <clear />
              <add name="Cache-Control" value="max-age=30,public" />
          </customHeaders>
      </httpProtocol>
</system.webServer>

But when I load the page, this is the response header:

Cache-Control: private,max-age=30,public

It is an ASP.NET MVC application, the controller has no cache directives specified anywhere.

Glenn Slaven
  • 31,855
  • 25
  • 107
  • 163
  • Unfortunately, IIS appends headers (with a comma) from the customHeaders section. – Ivan Hamilton Jun 06 '12 at 06:13
  • 1
    Yeah, I know, I just can't figure out where the 'private' is coming from. It's very frustrating! – Glenn Slaven Jun 12 '12 at 13:07
  • Did you solve it? I have the same issue, but since we're using DNN, I'm assuming it comes from there. – H.Wolper Apr 01 '14 at 08:25
  • possible duplicate of [Cache-control: no-store, must-revalidate not sent to client browser in IIS7 + ASP.NET MVC4](http://stackoverflow.com/questions/22443932/cache-control-no-store-must-revalidate-not-sent-to-client-browser-in-iis7-as) – Joe Feb 15 '15 at 09:33

1 Answers1

5

try this

<system.web>
    <httpRuntime sendCacheControlHeader="false" /> 
 </system.web>

Let us know how it goes.

Jason

Jason A
  • 89
  • 1
  • 8