C # Cache Management in Code or IIS 6

When one of my websites is browsed through the 3G mobile network, the o2 network operator in this case rewrites the page and embeds all the styles in a line, which leads to page breaking. Because style rules are not followed properly.

Now I understand that with the guys in o2 I can stop this by adding the Cache Control "no-transform" header to my site.

The problem is that adding this through an IIS dosn't seam does nothing. and you cannot add a "no-transform" cache control via code in .net as one of the parameters of system.Web.HttpCacheability.

Any idea how I can get this headline and stop the page forged by the mobile operator.

+3
source share
3 answers

You can use the Response.AddHeader method , for example:

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

This has been tested with Firebug and it looks fine.

+3
source

Response.Cache.SetNoTransforms in Page_Load

+4
source

Alternatively, you can add a meta tag to your HTML, for example:

<meta http-equiv="Cache-Control" content="no-transform" />
+1
source

Source: https://habr.com/ru/post/1780053/


All Articles