سؤال

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