私はApache 2.2でmod_deflateを使用しており、圧縮レベルは 9 に設定されています。YSlow (v2)の推奨事項に基づいて、サイトのすべての可能な側面を微調整し、全体的に A グレード (合計スコア: 91) および以下を除くすべてのカテゴリーについて:
- HTTP リクエストの数を減らします (グレード C - 画像のさらなる統合に取り組んでいます)
- コンポーネントを gzip で圧縮 ( Grade F )
YSlow はまだ F を返し、CSS および JS ファイルで gzip を使用するように指示します。YSlow レポートのスクリーンショットを次に示します (プライバシーのために、ドメインはぼかしてあります)。
ただし、GIDNetwork GZIP Testのようなサイトでは、完全な圧縮が報告されています。
私の .htaccess の mod_deflate セクション
# Below uses mod_deflate to compress text files. Never compress binary files.
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
# compress content with type html, text, js, and css
AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript text/xml image/svg+xml application/javascript application/x-javascript application/atom_xml application/rss+xml application/xml application/xhtml+xml application/x-httpd-php application/x-httpd-fastphp
# Properly handle old browsers that do not support compression
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Explicitly exclude binary files from compression just in case
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.avi$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mov$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp3$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp4$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.rm$ no-gzip dont-vary
# properly handle requests coming from behind proxies
Header append Vary User-Agent env=!dont-vary
</IfModule>
誰かが私が間違っているところを指摘できますか?
ありがとう、m^e