Why is gzip compression with Internet Explorer not working?

前端 未结 4 1481
青春惊慌失措
青春惊慌失措 2020-12-14 13:39

My site is gzipped compressed, and it doesn\'t load properly in IE. It works fine in FF/Chrome, but in IE, the only thing that pops up is a box asking to download the .gz fi

4条回答
  •  无人及你
    2020-12-14 14:12

    Are you sending the correct headers?

    You need to send the

    Content-Encoding: gzip
    

    header for IE to understand that it is gzipped (Firefox, et al are smart enough to detect this automatically - even though they shouldn't!)

    In PHP, you can do this using:-

    header('Content-Encoding: gzip');
    

提交回复
热议问题