문제

When one of my websites is viewed over a mobile 3G network the network operator o2 in this case is rewriting the page and embedding all the styles in-line, this is causing the page to break. As the styles rules are not followed properly.

Now I understand from the guys at o2 that I can stop this happening by adding a Cache Control heading of "no-transform" to my site.

The problem is that adding this via IIS dosn't seam to do anything. and you cant add the cache control "no-transform" via code in .net as its not one of the system.Web.HttpCacheability options.

Any idea how I can get this header in and stop the page being tampered with by the mobile operator.

도움이 되었습니까?

해결책

You should be able to use the Response.AddHeader method, like this:

Response.AddHeader("cache-control", "no-transform");

Verified this with Firebug, and it looks OK.

다른 팁

Response.Cache.SetNoTransforms in Page_Load

Alternatively, you could add a meta element to your HTML, like so:

<meta http-equiv="Cache-Control" content="no-transform" />
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top