Few Optimizations for my Blog

It’s been a while I touched any of configurations. But few days ago I was reading DZone article about web application performance and tried one of the tool described there – Google’s PageSpeed Insights. And I was slightly disappointed to see that my WordPress is not 100% optimal! While nothing I can really do with recommendations about JavaScript, CSS or even images (unless I hack into WordPress), I found that enabling compression is doable. StackOverflow is the winner again. So I created /etc/httpd/conf.d/deflate.conf with this content:

SetOutputFilter DEFLATE
# mod_deflate configuration
<IfModule mod_deflate.c>
# Restrict compression to these MIME types
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xml+rss
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/css
<IfModule mod_headers.c>
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
</IfModule>

After restarting Apache and running PageSpeed again I got 93/100 for Desktop Optimization!

After updating Sucuri plugin I also noticed one new security recommendation: Disable Server Banners. Essentially they recommend to turn off any information exposing your server version and modules. For that I just added two lines to /etc/httpd/conf/httpd.conf:

ServerSignature Off
ServerTokens Prod

And the last minor note that I had no issues with upgrading my AWS instance to Amazon Linux 2018.3. And they actually help you to do that in motd:

sudo yum clean all
sudo yum update

And you will get latest Linux 4.14 kernel and bunch of updates. I encountered no issues with my WordPress after restarting my box.