Friday, 15 June 2012

IIS 7.5 forces the http header CacheControl to Private -


My In the NET code, I have a custom handler that is in the process of the HTTP process and is called a custom HTML module to call the processor method in the HTTP cache header.

The HTTPS module sets the header in the preceded sequence header system with the following code

  http cache policy = cache = response Cache; If (cache! = Null) {cache.SetCacheability (HTTPCPL.Public); Cache.SetMaxAge (TimeSpan.FromSeconds (varnishDuration)); reaction. AppendHeader ("Edge-Control", String.Concat ("! No-store, max-age =", Akamai period, "S DCA = Nop")); }   

In IIS 7.5, with the pool in integrated mode, the cash control is forced to private. What I found here:

  curl -IXGET -H "host: myHostName" "http: // myServer / mypage" HTTP / 1.1 200 OK cache-control: Private server: Microsoft-IIS / 7.5 X-espant-version: 4.0.30319 edge-control:! No-store, max-age = 300 s dca = noop [...]   

I do not understand IIS changes the cache control in private.

My web My webserver section is in the config:

  & lt; Pre & gt; & Lt; System.webServer & gt; & Lt; Handler Access Policy = "Read, Script" & gt; & Lt; Add name = "Oxygen Handler" verb = "*" path = "*" type = "com.eurosport.oxygen.server.modules.OxygenHandlerFactory, OxygenServerModule" /> & Lt; / Operators & gt; & Lt; Run the moduleAll managed modules FOR ALLRequests = "true" & gt; & Lt; Add name = "WebServiceCachingModule" type = "com.eurosport.toolkit.WebServiceCachingModule, Eurosport.Toolkit" /> & Lt; / Module & gt; & Lt; /system.webServer> & Lt; / Pre & gt;   

I have been told here that tried to add SetSlidingExpiration but it does not help.

I have been able to work with this code in my module: < Pre> feedback Header. Remove ("cache-control"); reaction. AppendHeader ("Cash-Control", "Public, Maximum-Age =" + Varnish Dictor. Toastring () + ", s-max-age =" + varnishDuration.ToString ());

It looks dirty but it seems that reaction. Cash Control and Response The cache property is not used by IIS in integrated mode (or is overridden by some modules ...)

No comments:

Post a Comment