Page Speed Optimizations
- Eliminate render-blocking JavaScript and CSS in above-the-fold content
- Remove render-blocking JavaScript
- Optimize CSS Delivery
- Enable compression (Apache: Use mod_deflate)
- Improve server response time
- Leverage browser caching
- Minify JavaScript
- Minify CSS
- Minify HTML
- Optimize Images
Apache Server Configuration and httpd.conf
/ .htaccess
Sample Configurations
The HTML5 Boilerplate project contains sample configuration files for all the most popular servers with detailed comments for each configuration flag and setting: find your favorite server in the list, look for the gzip section, and confirm that your server is configured with recommended settings.
Copy and use the .htacces template template.
You need to enable the Apache mods required for the configurations used in the template. On Linux, open a terminal and:
sudo a2enmod setenvif headers deflate filter expires rewrite include
sudo /etc/init.d/apache2 restart
Enabling Website Compression in WHM/cPanel
If on a CentOS/cPanel server, use EasyApche to enable the ‘Deflate’ module. Software > EasyApache (Update Apache). Once you have the ‘Deflate’ module enabled, you’ll have to enable compression for each individual website under cPanel > Software/Services > Optimize Website.
See the cPanel documentation about enabling mod_deflate and using the ‘Optimize Website’ option.
Links
- Apache Server Configs
- How to enable Apache modules
- server-configs-apache/dist/.htaccess
- cPanel Docs - Apache Module: Deflate
- Check Gzip Compression