2010-05-23 69 views
2

我嘗試包括來自外部源css.gz外部css.gz,但依然沒有作品在所有瀏覽器包括在Drupal主題

<link rel="stylesheet" type="text/css" media="all" href="http://www.website.com/style.css.gz" /> 

我不知道是什麼問題

(我的網絡服務器:Nginx等測試服務器:Apache)

感謝

回答

1

如果你有機會到.htaccess文件,你可以使用這個腳本來gzip壓縮的CSS只支持它的瀏覽器:

# This uses mod_deflate, which is pretty standard on Apache 2. Loading 
# mod_deflate looks like this: 
# 
# LoadModule deflate_module modules/mod_deflate.so 
# 
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript 
BrowserMatch ^Mozilla/4 gzip-only-text/html 
BrowserMatch ^Mozilla/4\.0[678] no-gzip 
BrowserMatch \\bMSIE !no-gzip !gzip-only-text/html 

查看原帖:How can I make my .htaccess file allow Safari & other browsers to open GZIP?