任何不添加“Cache-Control:no-transform”的原因标题到每个页面? [英] Any reason not to add "Cache-Control: no-transform" header to every page?

查看:1599
本文介绍了任何不添加“Cache-Control:no-transform”的原因标题到每个页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们最近在我们的网站上修复了类似于如何停止从沃达丰代理注入javascript? - 基本上,沃达丰移动网络正在破坏我们的传输页面,编辑了破坏视图模型的JavaScript。

We have recently fixed a nagging error on our website similar to the one described in How to stop javascript injection from vodafone proxy? - basically, the Vodafone mobile network was vandalizing our pages in transit, making edits to the JavaScript which broke viewmodels.

将Cache-Control:no-transform标题添加到遇到问题的页面修复它,这很棒。

Adding a "Cache-Control: no-transform" header to the page that was experiencing the problem fixed it, which is great.

但是,我们是我们担心,随着我们使用JavaScript MVP技术进行更多客户端开发,我们可能会再次看到它。

However, we are concerned that as we do more client-side development using JavaScript MVP techniques, we may see it again.

是否有任何理由不在每个提供的页面中添加此标头通过我们的网站?

Is there any reason not to add this header to every page served up by our site?

这是否会阻止任何有用的转换?或者它基本上只是运营商做出类似火箭的尝试来缩小事物并在此过程中破坏它们的类似例子?

Are there any useful transformations that this will prevent? Or is it basically just similar examples of carriers making ham-fisted attempts to minify things and potentially breaking them in the process?

推荐答案

不添加此标头的原因是速度性能和数据传输。

The reasons not to add this header is speed performance and data transfer.

某些代理/ CDN服务会对媒体进行编码,因此如果您的客户端位于代理服务器之后,或者您使用的是CDN服务,客户端可能会获得更高的速度并花费更小的数据传输。这个标题实际上命令代理/ CDN - 不对媒体进行编码,并按原样保留数据。

Some proxy / CDN services encode the media, so if your client is behind proxy or are you using a CDN service, the client may get higher speed and spend littler data transfer. This header actually orders proxy / CDN - not to encode the media , and leave the data as is.

所以,如果你不关心这个或你的应用程序不要使用许多文件,如图像或音乐,或者你不想对你的流量进行任何编码,没有理由不这样做(相反,推荐)。

So, if you don't care about this, or your app not use many files like images or music, or you don't want any encoding on your traffic, there is no reason not to do this (and the opposite, recommended to).

请参阅此处的RFC: http://www.w3.org/Protocols/ rfc2616 / rfc2616-sec14.html#sec14.9.5

See the RFC here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.5

这篇关于任何不添加“Cache-Control:no-transform”的原因标题到每个页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆