mod_deflate压缩导致swf文件无法正常工作

时间:2013-10-13 21:34:37

标签: .htaccess compression flash mod-deflate

我的服务器上最近启用了mod_defalte以压缩某些文件。

我认为设置不会导致.swf文件出现任何问题,但是因为我遇到了与运行.swf文件但没有通过加载屏幕有关的问题。

mod_deflate目录htaccess config

<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>

我注意到有很多与压缩和.swf文件相关的问题,但我不确定为什么mod_deflate会在设置如上运行时影响它们?

可能的原因?

我在WHM中有以下设置 - &gt; Apache配置 - &gt;包含编辑器,这些是默认的mod_deflate设置还是我添加的内容?

我只想进行基本配置,如上例所示,我应该删除post_virtualhost_global.conf设置吗?

mod_deflate - post_virtualhost_global.conf

<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
<IfModule mod_setenvif.c>
# Netscape 4.x has some problems…
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won’t work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

# Don’t compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
</IfModule>

<IfModule mod_headers.c>
# Make sure proxies don’t deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
</IfModule>

来源

mod_deflate和.swf Flash文件问题:https://www.google.co.uk/search?q=mod+defalte+defaults&oq=mod+defalte+defaults&aqs=chrome..69i57j69i60l5.3099j0&sourceid=chrome&espv=210&es_sm=122&ie=UTF-8#es_sm=122&espv=210&psj=1&q=mod_deflate+flash+files

1 个答案:

答案 0 :(得分:2)

Web服务器配置中的此指令:

SetOutputFilter DEFLATE

为所有文件启用DEFLATE压缩。您不希望这样 - 随着Flash文件的混乱,对于已经压缩的数据(包括大多数图像格式)来说,这是浪费时间。删除它,以及跟随它的所有过时的废话。 (你所拥有的大部分内容都是史前浏览器和网络服务器的解决方法。)

相关问题