WordPressの高速化

GooglePageInsightを使用してサイトを高速化するための改良箇所を調べた所、gzipが利用できることがわかりました。

https://developers.google.com/speed/pagespeed/insights/?hl=ja

こちらのサイトを参考にし、設定ファイル/etc/nginx/nginx.confを変更しました。

http://server-setting.info/centos/apache-nginx-6-gzip-use.html


http { ... log_format deflate '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for" "$gzip_ratio"'; access_log logs/deflate.log deflate; ... gzip on; gzip_http_version 1.0; gzip_types text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/atom_xml application/javascript application/x-javascript application/x-httpd-php; gzip_disable "MSIE [1-6]\."; gzip_disable "Mozilla/4"; gzip_comp_level 1; gzip_proxied any; gzip_vary on; gzip_buffers 4 8k; gzip_min_length 1100; ... server { server_name www.example.com; : } }

結果、ページへのアクセスが0.1秒ほど早くなり高速化に成功しました。