Want to increase the speed of your website easily, in a few simple steps? Activation of mod_deflate (mod_gzip) and mod_expires is probably the first thing to do before optimizing your scripts.
Before beginning, here is a little more explanation on these two systems:
Gzip et Deflate (mod_gzip and mod_deflate)
The cache-control also called mod_expires is an Apache module for delivering a resource only if it is not in the cache of the visitor’s browser and, if so, the client will not have to re-download this resource, the module will load the resource directly from the browser cache, so no request will have to be done on the server.
Enabling Gzip et Cache-control
By default, these modules are installed on all our servers. To enable these options, very simple, add the code below at the beginning of the .htaccess file located in the root of your website (usually in the public_html). If the .htaccess file does not exist, you can create it. If there are already values present in the .htaccess file, you must leave what is present and add your code at the absolute beginning of the file. You can do this via FTP or directly with the file manager that is in your cPanel account:
Now you just activated Gzip and Cache-control on your site, these entries should be good for 90% of CMS and web sites, you can adjust it as needed. You can use the Dareboost tool to validate if it is active on your site. Please note that these values only affect resources hosted on your server, not the resources hosted on other servers, such as fonts hosted at Google. If the result is negative make sure that you have entered it in the right .htaccess file.