How to increase page loading speed on a website


One of the basic SEO recommendations for improving the behavioral factors on the site is the need to increase the page loading speed. And indeed: the faster the site works, the more pleasant it is to use it, and both visitors and optimizers agree on this.

Why is the site running slowly?

What happens when the page opens? At this point, the content is transferred to the client, search engine, parser or browser. Four factors affect download speed:

  • how far (geographically) the server is located from the client;
  • what content is transmitted - codes or images;
  • How exactly is the data transferred?
  • how the content is generated.

What can be influenced? Of course, first of all, on the Front-end and Back-end of the site, that is, directly on the type of content and the way it is generated. But the remoteness of the server from the client is not always subject to the owners of the resource. However, there are acceleration technologies here too.

Geographic distance

The greater the distance between the server and the client, the higher the ping will be - the very time for which a certain packet of information is transmitted. But it's not just time that matters. Both the route and the overall congestion of the channel are important. Keep in mind that DNS requests from each page are sent to each of the domains mentioned on the page. But when choosing a good server, you will not notice any problems: often the total connection time to the servers does not exceed 2% of the total download time.

Content Type or Front-end

Content should be optimal in size and properly distributed across the page. Here are the main problems in this category that prevent the site from working quickly:

Images: can be large and very large, the wrong format (JPEG loads much faster than PNG-24), too high resolution (for example, a print layout instead of a regular photo). You need to use special plugins for image processing, as well as control the "technical characteristics" of all photos and pictures that you are going to post on the site. site statistics can be used to estimate the volume of images. It's also important to keep the number of images to a minimum, leaving the ones that really matter, in order to reduce the frequency of server calls.

Program code. For CSS and JavaScript, the basic complexity is still the same: the number of files + their size. If the site is handled by professional developers, they can minimize all this data at the development stage. In practice, it often happens differently: an already existing site with difficulties in loading gets to be optimized. The size of JavaScript files is changed by deleting comments and line breaks, as well as replacing variable names with short ones. Reducing the number of files and avoiding conflict is more difficult. But you can use minification technology: there are special automated services that compress and merge js and css files. This ensures an increase in resource productivity.

Transfer rate: ways to optimize

If it is not possible to recycle the content, you can increase its bit rate. There are 6 technologies for this. They can be tested independently of each other and choose the appropriate option:

  1. Text compression . This download acceleration method is recommended by HTTP1.1. For compression, in most cases Gzip is used, a popular algorithm in Unix systems. The compression method is similar to that used in zip archives. Thus, you can reduce the amount of textual information (including program code and html, but not pictures). You can check the compression by running "test server response" in Webmaster. You can also use the .htaccess file with instructions added to it for compression.
  2. Browser caching . When caching, the browser saves a copy and opens the already copied and saved copy of the page. The server sends information about page changes to the browser. There are several types of headers sent by the server - for example, Expires, by the time until which the content is considered relevant, or Last-Modified, by the time it was last modified. Before showing the page to the user, the browser checks all allowed headers. Therefore, the visitor always sees up-to-date information. It is better if the content is generated from the very beginning by the php service programming language. This will help provide better control.
  3. HTML cache of dynamic pages on hard disk. The cache can be stored on the hard drive or in the server's RAM, so the pages will open as quickly as possible. But the professional implementation of caching technologies is very important, otherwise you can overload the RAM. There are several popular caching plugins.
  4. Asynchronous loading In this case, plugins are loaded in parallel with the base content. To enable this method of loading, it is enough to add the async attribute to the script tag.
  5. CDN technology for parallel downloads. You can transfer some of the content to another domain or create a subdomain to store the heaviest parts of the site. CDN technology allows you to place static content on a network of distributed servers, minimizing the impact of the geographical factor. To launch this technology, they turn to CDN providers.
  6. The HTTP/2 protocol , which allows you to download all files in parallel, as a single stream. However, a server software update may be required to run the new protocol.

Content generation methods

The performance of the site is greatly affected by the work of the server, that is, the immediate response time when loading the page. If a server response is not reached within 10 seconds, Yandex.Metrica may consider the site to be inoperable.

Server speed is affected by preset settings. Most often, the Nginx + Apache bundle is used for high-quality sorting of requests and their fast transmission.

You also need to choose the correct PHP mode. By default, it works in CGI mode, which is not very productive. The mod_php mode provides more performance but is resource intensive. For high-load sites, you will need FastCGI (or FPM) mode.

The server may take a long time to respond due to the long processing of queries to the databases. When working with a database, it is important to check all the settings, including: the volume and efficiency of the query cache, the number of allowed simultaneous connections, the amount of physical memory on the server. You can set up long queries, and then determine which of them load the database for the longest time.

All of these are effective ways to optimize website loading speed. More specific recommendations can be given only after analyzing a specific resource.

Last in our blog

Internet Marketing