loading...
The speed of your website is important. It affected the user experience, bounce rate, your place in search results (it's 1 of the many ranking factors) and more.
An effective way to make your website faster is by using Gzip compression, sometimes referred to as browser compression.
Once you've created zip files, you may have noticed that these files are smaller than the original files. This is due to compression.
The files on your WordPress website are exactly the same and it's only recommended to do something about it. In this article, I'm going to tell you how to enable Gzip compression on your WordPress website.
How does Gzip compression work?
It may be interesting to know how compression works before you implement it on your own WordPress website. When a visitor visits your website, he will see your website thanks to the help of HTML, CSS and JavaScript code.
All of this code and files where the code is allowed must be downloaded by the browser at a website visit so that the browser displays the website as it is in code.
This is as it should be, the only thing is just that the code is displayed for human eyes, so it's easy to read and read. In addition, the same patterns and elements are often used, which frequently repeats things.
For browsers, however, all code does not have to be displayed correctly. It must be as clear as possible, as long as it is for the browser to be decomposed. Compression algorithms such as Gzip recognize patterns and repetitions within texts, and then save them in a very efficient way, thus decreasing the size.
How do you enable Gzip compression for WordPress?
Gzip compression is actually separate from WordPress and is fully regulated by the server where your website is created. It's not so that you really need to install a special plugin, although these are WordPress, of course.
You have three ways to enable Gzip compression for your WordPress website, so it will definitely work you out. You can ask your hosting provider, you can enable it yourself via the .htaccess file and you can enable a plugin.
However, before we do anything, it's a good idea to first see if Gzip has already been enabled. It may be that your hosting provider already does this by default.
To see if Gzip is enabled on your WordPress website, visit the CheckGZIPcompression.comwebsite. When you get the message "GZIP is not enabled," you can follow the steps below to enable it on your website.
Ask your hosting provider
The .htaccess file is a file that you should not be wrong with, because problems may occur with your website. It is not very difficult to enable Gzip through this file, but if you prefer not to do it yourself, you may want to ask your hosting provider best.
When you are a good hosting provider that provides service, this will often be no problem and done for you.
Enable Gzip compression through .htaccess
To enable Gzip compression via .htaccess, you will need to log in to your server via FTP to customize the .htaccess file in the root of your WordPress installation. If you do not see the file, take care that your FTP program also shows the hidden files.
Another option is to edit the .htaccess file through the Yoast SEO plugin. You can get here via "SEO -> Extra -> File Editor".
Once done to edit the .htaccess file, we only need to add the following code:
1 | # compress text, html, javascript, css, xml: |
2 | AddOutputFilterByType DEFLATE text/plain |
3 | AddOutputFilterByType DEFLATE text/html |
4 | AddOutputFilterByType DEFLATE text/xml |
5 | AddOutputFilterByType DEFLATE text/css |
6 | AddOutputFilterByType DEFLATE application/xml |
7 | AddOutputFilterByType DEFLATE application/xhtml+xml |
8 | AddOutputFilterByType DEFLATE application/rss+xml |
9 | AddOutputFilterByType DEFLATE application/javascript |
10 | AddOutputFilterByType DEFLATE application/x-javascript |
11 | AddOutputFilterByType DEFLATE font/ttf font/otf image/svg+xml |
12 | AddType x-font/otf .otf |
13 | AddType x-font/ttf .ttf |
14 | AddType x-font/eot .eot |
15 | AddType x-font/woff .woff |
16 | AddType image/svg+xml .svg |
17 | AddType image/x-icon .ico |
18 | AddType image/png .png |
It does not matter where you place it. You can place it both above # BEGIN WordPress and under # END WordPress. I've got it over myself. Save the file and upload it again (unless you do it via Yoast).
Enable Gzip compression with a plugin
When using a caching plugin as WP Super Cache, W3 Total cache or WP Rocket, you also have the ability to enable compression.
In these plugins, you must look at the compress / compression option. For example, in the WP Super Cache, in the advanced settings, you have the option "Compress pages so they are served more quickly to visitors."
It's not a lot of work, therefore, if you use a caching plugin, it's a matter of checking. There are also other plugins that can do this, but I read a lot of bad reviews for most plugins that caused problems. So I can not recommend a plugin with only the option to enable Gzip compression.
Verify that Gzip compression works well
Once you've set up Gzip compression on your website, it's a good idea to check if it's working properly. You can check this again on the website Check GZIP Compression . If it's ok, you'll see:
If you are not notified that Gzip compression is enabled, it does not mean that you have done something wrong. For example, if you use a caching plugin, it may take some time for the website cache to be completely up-to-date.
Once you've realized that Gzip is enabled, you've made your website faster. It was quite simple to run, but it is worthwhile for your website.
Post A Comment:
0 comments so far,add yours