I'm trying to get mod deflate and gzip setup on my server. It's all working swimmingly but it does not appear be be catching all files. It's not that it is missing ALL javascript or ALL CSS. It appears to be missing some javascript and some CSS.
我正在尝试在我的服务器上进行mod deflate和gzip设置。这一切都在游泳,但它似乎并没有抓住所有文件。并不是它缺少所有的javascript或所有CSS。它似乎缺少一些JavaScript和一些CSS。
For example, the following CSS IS NOT being compressed:
http://www.discussthemarket.com/global-assets/css/bootstrap/bootstrap.min.css
例如,以下CSS未被压缩:http://www.discussthemarket.com/global-assets/css/bootstrap/bootstrap.min.css
Whereas the following CSS IS being compressed: http://www.discussthemarket.com/assets/css/bootstrap.default.css
以下CSS被压缩:http://www.discussthemarket.com/assets/css/bootstrap.default.css
Here is my config in my htaccess
:
这是我在htaccess中的配置:
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
I have googled til the cows come home and nothing is working. I've also tried various variations on the config above all in vain.
我一直用谷歌搜索,直到奶牛回家,没有任何工作。我也尝试了配置上的各种变化,但都是徒劳的。
1 个解决方案
#1
-1
Well I have found the solution though I do not know why it is working:
好吧,我找到了解决方案虽然我不知道它为什么工作:
solution
removed the htaccess directives and created a conf.d file instead on server :\
删除了htaccess指令并在服务器上创建了一个conf.d文件:\
# DEFLATE by type - html, text, css, xml
AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml
# DEFLATE by type - javascript
AddOutputFilterByType DEFLATE application/x-javascript application/javascript text/javascript text/x-js text/x-javascript
# DEFLATE by extension
AddOutputFilter DEFLATE js css htm html xml
#1
-1
Well I have found the solution though I do not know why it is working:
好吧,我找到了解决方案虽然我不知道它为什么工作:
solution
removed the htaccess directives and created a conf.d file instead on server :\
删除了htaccess指令并在服务器上创建了一个conf.d文件:\
# DEFLATE by type - html, text, css, xml
AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml
# DEFLATE by type - javascript
AddOutputFilterByType DEFLATE application/x-javascript application/javascript text/javascript text/x-js text/x-javascript
# DEFLATE by extension
AddOutputFilter DEFLATE js css htm html xml