Now a few words about the server, the place where our website files are located. The technologies and functions available on hosting are a very important factor influencing how quickly the website files will appear in our browser.
If website optimization has not yielded results in reducing the site's loading time, then it can be concluded that the fault lies with the server.
11. Gzip, Deflate or Brotli compression
These are methods that compress our website files without loss, and are performed on the server side. As a result, our browser receives fewer resources, which shortens the time it takes to load the website. The efficiency of compression using the Gzip and Deflate methods is very similar, but in the case of using Brotli compression, we can count on about 20% better compression.
What files should be compressed using Gzip, Deflate, Brotli? Generally, we will achieve the most by compressing text files, including HTML, CSS, JavaScript, XML, fonts, where their volume can be reduced by up to 70-80%. We should not compress previously compressed files and we should skip photos.
How to enable gzip, deflate or brotli compression? You can do it from the top on the server. You can also paste the appropriate code in the .htaccess file , which is located in the main directory with the site files on the server. If your site is based on the WordPress engine , you can enable file compression by installing the WP Fastest Cache plugin . Just check the appropriate checkbox when configuring it.
compression using the WP Fastest Cache plugin
WP Fastest Cache plugin settings
Enabling Gzip method in .htaccess file
Enabling the Brotli method is possible, for example, using the CloudFlare service in the CDN network, which will be discussed later.
After making changes, test the page in the previously mentioned tools and check the result.
12. PHP version
If our website, such as WordPress, PrestaShop, Joomla is based on PHP, then the version of the PHP interpreter on the server is very important for the speed and efficiency of the website. How does it work? Before the server sends our website files to the user's browser, the PHP code must be processed on it.
comparison of PHP versions on the server
Number of queries executed per second
source: https://kinsta.com/blog/php-benchmarks/
The newer the PHP version, the greater and more noticeable the efficiency of PHP code processing on the server, and therefore the faster we will receive the response and page files.
How to check PHP version and how to change it?
Not all hostings allow you to use the latest version, so it is worth paying attention to this when choosing a server. Of course, we change the PHP version in the panel or by contacting the hosting provider. To check what version is set, log in to the panel of your hosting provider. An alternative way is to create a file, e.g. named “version.php” with the function . Then, the file should be uploaded to the server with the page files and called in the browser. As a result, we will receive the server configuration, where the PHP version is given in the main header. As in the image below.
php file address
PHP version check
PHP version set on server
After updating the PHP version, it is essential to analyze the operation of the entire site, as some elements may stop working properly. This is because with new versions of PHP, older functions are replaced by new ones, which may cause them to not function properly or return a different result.
A few sample elements that we should check after updating the PHP interpreter: the operation of forms, galleries, menus. In the case of stores, additionally payments, orders, cart. The acceleration of the www page applies to the entire service.
13. HTTP/2 Protocol
It defines how the browser communicates with the server and how resources are transported between them. Earlier versions of HTTP/1.x sent requests for resources sequentially, i.e. the browser requests a file, receives it from the server, processes it, requests another, etc. Using the HTTP/2 protocol speeds up page loading, thanks to handling multiple requests at the same time. Additionally, the server has the ability to send files before the browser asks for them.
When choosing hosting, we should also pay attention to the version of the HTTP protocol used by the server. How to enable the HTTP/2 protocol? If the server uses HTTP/2, it is usually enabled from above, but it is worth checking the settings in the hosting panel. An alternative version of using the HTTP/2 protocol is to connect to the CloudFlare service, which uses this solution and provides many more benefits, which I will describe below.
Server Response Time TTFB (Time To First Byte)
What is TTFB? It is the time measured from the moment the query is sent to the moment the first byte of data is received from it. As a result, we get the time in which the server responded to the query.
What affects the long response time of the TTFB server? Of course, there are many factors that affect how quickly the server responds to a query. The main cause may be the server configuration, its parameters and location. This also applies to the PHP interpreter version, current load and DNS servers. Longer query and response processing times may also be affected by complex database queries, extensive PHP functions and scripts and non-optimal code. How to speed up the server response time? The above factors should be analyzed and corrected. Most of them are described in this article.
Is there anything else we can do?
Of course, we can also use a network of servers located around the world, of course we are talking about the CDN service. I will discuss how it works below.
14. Cloudflare CDN
This is a service of a network of servers located all over the world, where we can place our website files. This solution speeds up the loading of the website, mainly when users are far from the main server, e.g. in another country. It is especially recommended to use the CDN (Content Delivery Network) when our marketing goal goes beyond the borders of skype database Poland. How does Cloudflare work? Regardless of where on earth we want to open the website, the static resources of the website will be downloaded from the nearest CDN server.
What else does Cloudflare CDN offer in the free version?
Using HTTP/2, (HTTP/3 coming soon)
Compressing files using the Brotli method,
Minification of JavaScript, HTML, CSS files,
Free SSL certificate,
Resource caching and more.
cloudflare server network
CloudFlare Servers
source: https://www.cloudflare.com/
How to connect to CloudFlare? You need to create a free account https://www.cloudflare.com/ , configure the service and change the DNS addresses in the domain management panel so that they point to CloudFlare servers. The time it takes for the DNS addresses to update and the site to be fully operational varies, it can be from a few minutes to several hours.
PROtip
You can update your DNS records in your domain panel by reducing the TTL to, for example, 15 minutes. Then wait a day for the changes to propagate. As a result, DNS servers will check your domain configuration more often and the process of switching to CloudFlare will be much faster.
Does your website need optimization?
Leave it to the professionals at KS!
Contact us!
Summary
Now you know how to speed up a website. By following the above tips, you will certainly feel the difference in the loading time of your website, and as a result, the bounce rate will decrease, conversions will improve , and positions in search results will improve. Of course, in the process of positioning a website, do not forget to optimize the content for selected keywords and acquire valuable external links.
What can we improve on the hosting side?
-
- Posts: 30
- Joined: Mon Dec 09, 2024 3:43 am