本文介绍了为什么使用Internet Explorer进行gzip压缩无法正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站是压缩的,并且在IE中无法正确加载。它在FF / Chrome中运行良好,但在IE中,弹出的唯一内容是要求下载包含该页面的html文档的.gz文件的框。



解决方案

您是否发送了正确的标题?



您需要发送

 内容编码:gzip 

标题让IE了解它是gzip(Firefox,等人足够智能,可以自动检测到它 - 即使它们不应该!)



在PHP中,你可以这样做: -

  header('内容编码:gzip'); 


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 file which contains the html document for the page.

Is this normal? Do I have to turn off gzip?

解决方案

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');

这篇关于为什么使用Internet Explorer进行gzip压缩无法正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 00:12