Apache deflate忽略javascript

我在我的htaccess中设置了deflate。 一切工作正常, 除了某些原因JavaScript文件被忽略。 我尝试了所有可能的AddOutputFilterByType DEFLATE与多个MIMEtypes的组合,但都没有效果。 它不是一个caching的问题,它实际上让我相信这是工作,直到我回家了一个双重检查。 目前我正在使用这个工具 ,网站在这里 。 你可以清楚地看到,除了js文件之外,所有东西都被压缩了(不像从google和css文件中的js,缺less正确的Content-Encoding)。

这是我目前的htaccess文件:

 <FilesMatch "\.(tpl|ini|log)"> Order deny,allow Deny from all </FilesMatch> <FilesMatch "\.(js|css)$"> SetOutputFilter DEFLATE # 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 # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary </FilesMatch> ExpiresActive On ExpiresDefault A0 <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$"> ExpiresDefault A3024000 Header append Cache-Control "public" </FilesMatch> <FilesMatch "\.(gif|jpg|jpeg|png|swf)$"> FileETag MTime Size ExpiresDefault A3024000 Header append Cache-Control "public" </FilesMatch> <FilesMatch "\.(xml|txt|html|js|css)$"> FileETag MTime Size ExpiresDefault A604800 Header append Cache-Control "proxy-revalidate" </FilesMatch> 

我有DEFLATE筛选器以外的文件匹配。

任何帮助表示赞赏,问候

编辑:

我已经find了问题。 网站是在ISA防火墙后面,从js文件中删除“Content-Encoding:gzip”。

也许问题是你的FilesMatch块。 我们使用AddOutputFilterByType取得了成功。

 # Compress output to save bandwidth and load faster AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript application/javascript BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html