Carson63000
Carson63000

Reputation: 4232

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

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.

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

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?

Upvotes: 21

Views: 23500

Answers (2)

Marta Garcia
Marta Garcia

Reputation: 121

Google has recently incorporated the service Google Web Light 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

Upvotes: 12

MeNa
MeNa

Reputation: 1487

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

Upvotes: 17

Related Questions