Improve your Website Performance with Compression
Enabling compression features on your website can vastly increase the performance of your website.
This occurs by instructing the server to compress data sent to the browser. The browser then proceeds to decompress the data it receives.
This reduces the amount of data physically sent to your client browser resulting in a shorter data transfer time. It’s actually very easy to implement. Data transfer can be reduced by more than 80% overall.
Add the following instructions to the bottom of your .htaccess file in your website document root folder.
# Start of UK Cheapest Optimisation
# Gzip Browser Compression and Cacheing Recommendation
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
# End of UK Cheapest Optimisation
That’s all there is to it. Data between the server and the client will now be compressed, smaller and faster.