What is the canonical method for an HTTP client to instruct an HTTP server to disable gzip responses?

前端 未结 3 1419
一个人的身影
一个人的身影 2020-12-16 14:13

I thought this was a simple google search, but apparently I\'m wrong on that.

I\'ve seen that you should supply:

Accept-Encoding: gzip;q=0,deflate;q=         


        
3条回答
  •  囚心锁ツ
    2020-12-16 14:50

    Many web servers ignore the 'q' parameter. The compressed version of a static resource is often cached and is returned whenever the request accepts it. To avoid getting compressed resources, use

    Accept-Encoding: identity
    

    The server should not serve you a compressed representation of the resource in this instance. Nor should any proxy. This is the default accepted encoding if none is given, but your client might add a default that accepts gzip, so explicitly providing 'identity' should do the trick.

提交回复
热议问题