2010-12-30 05:54

Apache 壓縮模組(mod_deflate) 設定參數

  1. # @version $Id: .htaccess 130 2010-09-29 10:03:56Z jax.hu $ 
  2.  
  3. RewriteEngine on 
  4. RewriteRule ^.*$ index.php 
  5.  
  6. php_flag magic_quotes_gpc off 
  7. php_flag register_globals on 
  8. php_flag output_buffering on 
  9.  
  10.  
  11. # 啟用 Apache 壓縮模組 
  12. <IfModule mod_deflate.c> 
  13.    AddOutputFilterByType DEFLATE text/css  
  14.    AddOutputFilterByType DEFLATE text/javascript  
  15.    AddOutputFilterByType DEFLATE text/js 
  16.    AddOutputFilterByType DEFLATE text/xml 
  17.    AddOutputFilterByType DEFLATE text/html 
  18.    AddOutputFilterByType DEFLATE text/plain 
  19.    AddOutputFilterByType DEFLATE image/svg+xml 
  20.    AddOutputFilterByType DEFLATE application/xhtml+xml 
  21.    AddOutputFilterByType DEFLATE application/xml 
  22.    AddOutputFilterByType DEFLATE application/rss+xml 
  23.    AddOutputFilterByType DEFLATE application/atom_xml 
  24.    AddOutputFilterByType DEFLATE application/x-javascript 
  25.    AddOutputFilterByType DEFLATE application/x-httpd-php 
  26.    AddOutputFilterByType DEFLATE application/x-httpd-fastphp 
  27.    AddOutputFilterByType DEFLATE application/x-httpd-eruby 
  28.    AddOutputFilterByType DEFLATE application/postscript 
  29.    AddOutputFilter DEFLATE html htm xml css js svg 
  30.  
  31.    # properly handle requests coming from behind proxies 
  32.    <IfModule mod_headers.c> 
  33.        Header append Vary User-Agent 
  34.    </IfModule> 
  35. </IfModule> 

參考來源:
mod_deflate - Apache HTTP Server:
mod_deflate - Apache 2.2 中文版参考手册
[Apache] 壓縮你的網頁 – mod_deflate/mod_gzip、ob_gzhandler、zlib | 阿駕零零壹 © 學習筆記:

0 回應: