Any reason not to add “Cache-Control: no-transform” header to every page?

后端 未结 2 458
日久生厌
日久生厌 2021-02-04 05:57

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 netw

相关标签:
2条回答
  • 2021-02-04 06:17

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

    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).

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

    0 讨论(0)
  • 2021-02-04 06:23

    Google has recently incorporated the service googleweblight so if your pages has the "Cache-Control: no-transform" header directive you'll be opting-out from transcoding your page in case the connection comes from a mobile device with slow internet connection.

    More info here: https://support.google.com/webmasters/answer/6211428?hl=en

    0 讨论(0)
提交回复
热议问题