代码或 IIS 6 中的 C# Cache Control
当通过移动 3G 网络查看我的网站之一时,网络运营商 o2 在这种情况下重写页面并嵌入所有样式,这导致页面损坏。由于没有正确遵循样式规则。
现在我从 o2 的人那里了解到,我可以通过向我的网站添加“不转换”的缓存控制标题来阻止这种情况发生。
问题是通过 IIS 添加它并不能做任何事情。并且您无法通过 .net 中的代码添加缓存控件“无转换”,因为它不是 system.Web.HttpCacheability 选项之一。
知道如何获取此标头并阻止移动运营商篡改页面吗?
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Page_Load 中的 Response.Cache.SetNoTransforms
Response.Cache.SetNoTransforms in Page_Load
您应该能够使用 Response.AddHeader< /a> 方法,如下所示:
用 Firebug 验证了这一点,看起来没问题。
You should be able to use the Response.AddHeader method, like this:
Verified this with Firebug, and it looks OK.
或者,您可以向 HTML 添加元元素,如下所示:
Alternatively, you could add a meta element to your HTML, like so: