我正在尝试使用 apache deflate 模块压缩从我的应用程序发送的 excel 电子表格。我在启用站点的文件中添加了以下行:
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/excel
但是似乎使响应数据更大???
使用 firebug,没有模块,我从应用程序下载了 xls 电子表格,它下载了 100Kb 的数据,文件系统上的文件大小也是预期的 100Kb。一旦我如上所述启用了 deflate 模块并重复该过程,下载的数据量为 295Kb?? 但是一旦保存在文件系统上,该文件仍然只有 100Kb。
作为一个实验,我手动压缩了保存的 xls 文件并将其压缩到 20Kb。
我在这里做错了什么?
使用放气(Firebug 输出):
200 OK xxxxxxx.co.za 293 KB
4.43s
ParamsHeadersPostPutResponseCacheHTML
Response Headers
Date Tue, 03 Nov 2009 13:01:43 GMT
Server Apache/2.2.4 (Ubuntu) mod_jk/1.2.23 PHP/5.2.3-1ubuntu6.4 mod_ssl/2.2.4 OpenSSL/0.9.8e
Content-Disposition attachment; filename="Employee List.xls"
Vary Accept-Encoding
Content-Encoding gzip
Content-Type application/excel
没有放气(Firebug 输出):
200 OK xxxxxxxx.co.za 100 KB
3.46s
ParamsHeadersPostPutResponseCacheHTML
Response Headers
Date Tue, 03 Nov 2009 13:06:00 GMT
Server Apache/2.2.4 (Ubuntu) mod_jk/1.2.23 PHP/5.2.3-1ubuntu6.4 mod_ssl/2.2.4 OpenSSL/0.9.8e
Content-Disposition attachment; filename="Employee List.xls"
Content-Length 102912
Content-Type application/excel