Apache Web Server performance tunning

出自啟示錄
跳轉到: 導覽, 搜尋

作者:Joe Horn( joehorn AT leobbs DOT net )

授權:[CC授權:姓名標示-非商業性-相同方式分享 2.5]


目錄

[編輯] ETAG

<Directory />
  FileETag All
</Directory>

[編輯] mod_cache

<IfModule mod_cache.c>
  CacheDefaultExpire 3600
  CacheMaxExpire 86400
  CacheLastModifiedFactor 0.1

  <IfModule mod_mem_cache.c>
    CacheEnable mem /

    # 51200 KBytes = 50 MBytes
    MCacheSize 51200

    MCacheRemovalAlgorithm LRU
    MCacheMaxObjectCount 13001

    # 1 Byte
    MCacheMinObjectSize 1

    # 102400 Bytes = 100 KBytes
    MCacheMaxObjectSize 102400
  </IfModule>
</IfModule>

[編輯] mod_deflate

<ifmodule mod_deflate.c>
  DeflateCompressionLevel 9
  AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
  AddOutputFilter DEFLATE js css
</ifmodule>

[編輯] mod_expires

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType application/x-shockwave-flash A604800
  ExpiresByType audio/x-ms-wma A604800
  ExpiresByType audio/x-wav A604800
  ExpiresByType image/bmp A604800
  ExpiresByType image/gif A604800
  ExpiresByType image/jpeg A604800
  ExpiresByType image/png A604800
  ExpiresByType text/css A604800
  ExpiresByType video/quicktime A604800
  ExpiresByType video/mpeg A604800
  ExpiresByType video/x-ms-asf A604800
  ExpiresByType video/x-ms-wmv A604800
</IfModule>

[編輯] mod_setenvif

<IfModule mod_setenvif.c>
    BrowserMatch "Mozilla/2" nokeepalive
    BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
    BrowserMatch "RealPlayer 4\.0" force-response-1.0
    BrowserMatch "Java/1\.0" force-response-1.0
    BrowserMatch "JDK/1\.0" force-response-1.0
    SetEnvIf User-Agent ".*MSIE [1-5].*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
    SetEnvIf User-Agent ".*MSIE [6-9].*" ssl-unclean-shutdown
</IfModule>