Use Gzip to Speed Up WordPress, Drupal or Joomla

Use Gzip to Speed Up WordPress, Drupal or Joomla

Gzip compression is an effective way to save bandwidth and speed up your site. Set it once and reap the reward of substantially increased speed of your webpages for the time of its life.

Your website speed is an important factor that impacts every aspect of your website, including user experience, purchases, shares, and search engine ranking.

Gzip compression is one of the easiest and most effective ways to improve your site’s performance. Similar to how you zip files on your computer, Gzip reduces the file size of each page your server sends to the recipient browser. Reducing file size results in faster page rendering.

WordPress Gzip Activation

There are 3 free methods to activating Gzip on a WordPress-powered website. The fastest and easiest way is to use a plugin. Both W3 Total Cache and WP Super Cache offer Gzip parameters.

The alternative is to modify the .htaccess file. Simply add the following code:

<IfModule mod_deflate.c> # Compress HTML, CSS, JavaScript, Text, XML and fonts AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/vnd.ms-fontobject AddOutputFilterByType DEFLATE application/x-font AddOutputFilterByType DEFLATE application/x-font-opentype AddOutputFilterByType DEFLATE application/x-font-otf AddOutputFilterByType DEFLATE application/x-font-truetype AddOutputFilterByType DEFLATE application/x-font-ttf AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE font/opentype AddOutputFilterByType DEFLATE font/otf AddOutputFilterByType DEFLATE font/ttf AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE image/x-icon AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/xml # Remove browser bugs (only needed for really old browsers) BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html Header append Vary User-Agent </IfModule> 

Joomla! Gzip Activation

Thanks to the dedicated Joomla! developers, activating Gzip on a Joomla! website does not require additional plugins. In fact, you can activate it with only 3 clicks. Go to the administrative Global Configuration (under the admin “System” menu). Click on the “server” tab. Then change the Gzip Page Compression parameter from “No” to “Yes”.

Drupal Gzip Activation

Activating Gzip on a Drupal-powered website requires modifying the .htaccess file. Simply add the following code to your .htaccess file (note: same code used for WordPress solution):

<IfModule mod_deflate.c> # Compress HTML, CSS, JavaScript, Text, XML and fonts AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/vnd.ms-fontobject AddOutputFilterByType DEFLATE application/x-font AddOutputFilterByType DEFLATE application/x-font-opentype AddOutputFilterByType DEFLATE application/x-font-otf AddOutputFilterByType DEFLATE application/x-font-truetype AddOutputFilterByType DEFLATE application/x-font-ttf AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE font/opentype AddOutputFilterByType DEFLATE font/otf AddOutputFilterByType DEFLATE font/ttf AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE image/x-icon AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/xml # Remove browser bugs (only needed for really old browsers) BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html Header append Vary User-Agent </IfModule> 

Verify Gzip Compression

Now it’s time to check and make sure your website is outputting compressed pages. Use GzipTest.com to check if your site is being compressed. Note: testing your homepage will suffice.

As you can see, enabling Gzip compression on a WordPress, Joomla!, or Drupal website is a painless process. If you experience issues, it’s likely that Gzip is either not installed or not configured correctly on your server. In such cases, contact the web hosting support team for assistance.

Is your website optimized? Show us a screenshot or send us a link to your Gzip test results. We love to celebrate website optimization.

Author

0 0 votes
Article Rating
Subscribe
Notify of
4 Comments
Oldest
Newest
Inline Feedbacks
View all comments
pepperstreet
7 years ago

Frankly, I have never used GZip compression in the past… due to my lack of knowledge and technical background infos. Is it really recommended for any site? Are there any drawbacks or even incompatibilities?

steve
steve
7 years ago
Reply to  pepperstreet

Occasionally it breaks badly coded add-ons. but that’s a good reason not to use that add-on. Yep – no reason not to turn this on.

pepperstreet
7 years ago
Reply to  steve

Thanks for your quick reply and confirmation. I might transform into a “Gzip-fanboy” then. 😉

Frederico
Frederico
6 years ago

Thank you, Joe!!! Your article helped reduce my website pageload size by 20%. I appreciate you taking time out to share this with us.

4
0
Would love your thoughts, please comment.x
()
x