Apache htaccessファイルのコードの例を見てきました圧縮はキャッシュの前であり、逆も同様です。どちらが正しい?私はredbot.orgをかなり使用していますが、キャッシュが問題を少なくした後に圧縮するようです。
回答:
回答№1は0この方法でgzip圧縮で圧縮できます:
<ifModule mod_deflate.c>
<filesMatch ".(css|js|x?html?|php)$">
SetOutputFilter DEFLATE
</filesMatch>
</ifModule>
ファイルをキャッシュするには、次のようにします。
<ifModule mod_headers.c>
<filesMatch ".(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
<filesMatch ".(css)$">
Header set Cache-Control "max-age=604800, public"
</filesMatch>
<filesMatch ".(js)$">
Header set Cache-Control "max-age=216000, private"
</filesMatch>
<filesMatch ".(x?html?|php)$">
Header set Cache-Control "max-age=600, private, must-revalidate"
</filesMatch>
</ifModule>
詳細については、次のページをご覧ください。 http://samaxes.com/2009/01/more-on-compressing-and-caching-your-site-with-htaccess/