Web resource speed is one of the essential points for both user experience and SEO marketing.
Numerous researches have proven that more than 50% of users close the webpage if it needs more than 3 seconds to load. This influences user experience negatively, increases the bounce rate, and results in a lower position of your website on the search results page.
Moreover, many search engines analyze page speed and prioritize faster loading websites in their ranking system.
Let’s find out what web app speed depends on and how to increase it.
Website loading speed depends on quite a number of different factors. In this article, we will focus on 3 key points:
When a user opens a website, the browser sends an HTTP request to the server. After the server has responded to that request, the content becomes visible. The time span between the request sent and the response received is called server response time.
This term is also called Time To First Byte, or TTFB.
The user perceives it as the time span between the moment they opened the website and the moment the page started loading.
Server response time depends on:
The main idea is easy to understand: the heavier your content, the longer it is going to load. Hence, the smaller the size of the elements published on your website, the better.
Yet it is important to maintain a balance between the file size and quality. Images weighing several kilobytes are certainly going to load faster. But if they look blurry or contain some barely distinguishable elements, this may create a bad impression of your services and reduce sales.
Your web app consists of images, videos, text content, graphic elements, and so on. While the page is loading, all these elements appear on the user’s screen altogether. This is called page rendering.
Page rendering speed can be tested using various services like the popular Page Speed Insight service.
Page rendering speed depends on the following factors:
In order to make the content appear on the page, the server needs to call the database that this content is stored in. The lack of database performance optimization can result in increased website load time.
This turns even more important if you use dynamic content (social networks, forums, recommendations lists in online stores, and any other content that isn’t stored in databases, can’t be used out of the box, and needs to be created on request). In this case, the system needs not just to retrieve the files but also to form an information block that the client is supposed to see.
Speeding up database performance is a priority task for experienced programmers. The first things that need to be done are as follows:
The further the server is located from the users, the longer it takes to process their requests and get responses. If all your clients live in the same region, there is no problem because you can just buy a server located nearby. For example, if all your target audience lives in Luxembourg, it is advisable to have your server also located in Luxembourg.
Yet in most cases the target audience of online businesses is scattered over different cities and countries, and having a server in each city is impossible.
This problem can be solved using CDN (Content Delivery Network) servers. It is a large number of connected servers (i.e., points of presence) that retrieve data from the origin server, cache them, and convey the information to the users.
CDN servers are usually placed as closely to the end users as possible. When a user opens your website, the request is sent to the nearest point of presence instead of being sent to the origin server. This reduces both the request path and the server response time.
When CDN servers are used, the information gets cached in the points of presence after the first request has taken place:
Using CDN not only reduces server response time but also enhances the server’s fault tolerance. In case of traffic surges the requests get distributed evenly among the nearest servers instead of being sent to the origin server altogether. This makes it possible to balance the server load and to stabilize website performance.
If you have a global project, you’ll need a CDN server featuring worldwide points of presence to speed up your website. Analyze the number of points of presence available and their location. First of all, they should be positioned in the regions where your clients live. The more points of presence, the shorter the response time and the more stable the system performance.
G-Core Labs CDN has more than 80 points of presence on all continents except Antarctica. Thanks to the excellent coverage, we can boast an average worldwide response time of about 30 ms. Our total network capacity exceeds 50 Tbit/s.
A high-capacity worldwide CDN can reduce server response time significantly. Yet you should bear in mind that it will only help in case your clients actually live far from the server. If this is not so and the server response time parameters are still poor, there must be another problem with the server, and enabling CDN won’t help.
To reduce server load, the first thing to do is cutting down the number of requests.
When loading a website, the browser sends requests for each of the page elements. The fewer elements there are on your website, the fewer requests the browser will need to send.
At that, to avoid changing page design, you can do the following:
In some cases, CSS sprites can even reduce image size and speed up content load. Note that inline images increase HTML file size. Combined files are also heavy. This is a double-edged sword: while cutting down the number of requests and reducing server response time, you make your content heavier.
If you have many heavy files, their combination will reduce the server load but this won’t result in any significant website performance speedup.
A more effective way of reducing server load is using origin shielding. It is an additional pre-caching server located between the points of presence and the origin server.
The main function of the shielding technology is preventing your server from getting too many requests. All requests from CDN servers first come to the shielding and only then to the origin server. As a result, the latter interacts only with the pre-caching server instead of interacting with the whole network.
This allows you to cut down the number of requests and process them faster, which leads to reduced server response time.
The origin shielding technology is available with many advanced CDN providers including G-Core Labs CDN.
Before sending a request to your website’s server, the browser needs to get its IP address. The information about domain names and their IP addresses is stored on DNS servers.
Before actually sending a request to the server, the browser first sends a request to the DNS server in order to receive the necessary IP address. For more information on the topic, read our article “What is a DNS server and how does it work?”.
The further the DNS server storing your domain names and IP addresses is located from your target users, the longer it will take to process the request, which increases server response time.
What can you do? Place your domain names on the DNS servers that are closest to your clients and opt for a reliable DNS hosting service featuring many locations and allowing you to balance the server load.
If you tried everything, and the server response time still leaves much to be desired, the reason may root in the server characteristics. Your current server might be unable to cope with such high load, and you’ll need to switch to a server with higher computer performance characteristics.
Calculate how much storage space and RAM are needed for your website to function properly and check if your current server meets these requirements.
If not, switch to a hosting plan with higher capacity or even to another provider.
If your project is growing on a large scale, the resources provided by the common hosting services may no longer be enough for you. Then it’s time to transfer your project to the cloud. You can read more about the differences between these two kinds of services in our article “Cloud vs hosting: which should you choose?”.
The smaller the page elements weigh, the faster they load. To speed up your website, reduce the size of all the files to a minimum.
But remember that size reduction shouldn’t make the file quality much worse.
To maintain high content quality while speeding up your website, use modern data compression algorithms like Gzip, Brotli, and WebP.
These algorithms provide lossless data compression. They reduce element size significantly without affecting their appearance. These algorithms can compress files “on the way” while the content is being sent to the users.
Gzip is only capable of compressing text elements. The algorithm finds similar lines in a file and unites them, which results in 60–70% page compression.
Brotli works with all content types. It is based on the user browser dictionary that stores almost 100,000 most frequent phrases and text fragments used online. The algorithm finds new text fragments in the files and conveys only them to the user while replacing everything else with the elements borrowed from the dictionary.
This technology makes it possible to compress content up to 20–25% more effectively than Gzip.
WebP is an algorithm used for image compression. At present, it is used as an effective PNG and JPEG analog. WebP carries out lossless image compression up to 26% more effectively than PNG and up to 25–34% more effectively than JPEG.
The compression process goes in two stages:
All the three algorithms are supported by the most popular browsers. Using them is a fine way of content load time reduction.
G-Core Labs CDN not only supports these algorithms but can also compress files. While delivering content, Gzip works on servers whereas Brotli works with the origin server shielding. This means that you don’t need to change compression settings or write code on your own. You can download the existing settings and code to the origin server, which will result in automatic content compression in the process of content delivery.
1. Place jаvascript files at the bottom of the page. As mentioned above, the most important elements should be the first to load. JS files aren’t considered as such.
The first thing that the user is supposed to see is the page content. It should become visible before the page loads completely. jаvascript files can be pretty heavy, this is why they should be the last to load.
2. Hide the elements that are not essential for the mobile version of your website. Nowadays users browse many websites on their smartphones. Mobile devices have a weaker performance than desktop PCs. In case of unstable mobile Internet connection, website load time can increase immensely.
If you don’t want to make your users wait for a long time, optimize the mobile version of your website and delete all unnecessary elements that can slow down your website operation.
Test our CDN for capacity and reliability on your own or schedule a free consultation with our managers. They will help you select a plan that best suits your goals.