What 'Content-Type' header to use when serving gzipped files?

前端 未结 1 826
名媛妹妹
名媛妹妹 2020-12-04 20:57

I\'m serving gzipped copies of my css / javascript files. As per a tutorial, I set the content-type as application/gzip when serving these files. However, chrom

相关标签:
1条回答
  • 2020-12-04 21:47

    Compressed content in the response is indicated in the Content-Encoding. The Content-Type should remain the same, that is, it should reflect the underlying media type that is compressed.

    Content-Type: application/javascript
    Content-Encoding: gzip
    

    See sections 14.11 Content-Encoding and 3.5 Content Codings of RFC 2616 for more information.

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