Statistics show that if a web page takes longer than 5 seconds to load, the bouncing rate rises to 70%. As the longer a user spends on your pages, the more chances they will consume your content. However, there are several factors that can lower your page speed, including large images and videos. In this post, we will cover the importance of testing website speed, actors lowering your page speed, and tools to test website speed in Linux.
Recommended Read: The (in)complete Guide To DOCKER FOR LINUX
Also Read: 3 methods to Install Plugins on Jenkins server
Why It Is Important to Optimize the Page Load Speed
Page load time refers to the time it takes to render a web page from the hosting servers and display it on the web browser. It is measured as the time that goes between a user clicks the link and the browser displays the entire page content.
As such, it is one of the things that most impact user experience and website performance. Page speed consists of three stages:
- The time from the user click until the requested HTML is delivered to the browser
- The time it takes to the browser to respond to the page load request
- The time the requested page loads on the browser.
Moreover, as of last year, Google has included page speed as a ranking variable. That means the search engine gives higher ranking to faster sites and penalizes slower ones. Therefore, it is crucial to improve as much as possible the page speed. For that matter, testing regularly is a good practice for improving website performance.
So what is considered a fast loading time? Let’s review some statistics:
- If it takes more than five seconds for a page to load, more than half of visitors will leave it. By having slow load times, you’re losing conversions and profit. However, there is a difference between pages that load in two seconds, which have a bounce rate of 9%, and pages with five seconds load speed, where the bounce rate skyrockets to 38%.
- As low as a 100-millisecond delay in page loading time can cause conversion rates to drop by 7%.
Factors That Slow Your Website Down
There are several issues that contribute to a slow website.
Slow hosting service
There may be an issue or glitch in the website backend such as mistakes with the code. Poorly-framed code causes issues that delay the website loading. Also, there can be an error in the host, or its resources may be insufficient for the website’s workload. Upgrading to the cloud can boost performance by providing access to more hosting resources. In addition, a good web caching process can preload the most visited pages.
Image size and dimensions
This is one of the aspects that most affect page load speed. Images that are not optimized for the web, load their weight on the speed of your page. Most organizations are using web image optimization software to edit and upload images, with several open source and enterprise solutions available.
There are four attributes you should consider when optimizing images for the web:
- Size of the image
- How many images are within a content’
- How are they formatted
- Including images within HTML with the “src” tag.
Some tips to improve the user experience related to images are:
- Keep the image size relevant to the page width—a standard image editor can crop and edit the dimensions without distorting the image.
- Reduce the size of the image—by minimizing the depth of its color.
- Change the format—it is best to use the JPEG version of an image as it is the one that keeps the highest quality while compressing the image.
- Keep the images at a minimum—a website overloaded with images is confusing and heavy.
Excessive HTTP requests
Since each element on the page getting downloaded from a browser demands an HTTP request, the more page elements, the higher the number of HTTP requests. This results in higher loading time, as the server needs to send a request for each element on the page.
High server response time
The server response should be under 200 milliseconds, if it takes more than that, then it is stalling your website. There are web monitoring solutions that can help keep the response time on track.
Not employing browser caching
Browser caching is a process where a browser saves images, scripts, and style sheets of a website. It effectively saves the user time.
How to Test the Website Speed in Linux Terminal
Testing website speed periodically helps detect issues on time. This section shows you how to test a website response time using a simple command and some tools. Scheduled tests should be implemented to:
- Perform the name resolution.
- To achieveCP connection to the server.
- To let the file transfer start.
- Transfer the first byte
- Identify the operation completion
cURL
This is a command-line tool to transfer data from and to a server. It uses protocols such as FILE, FTP, FTPS, HTTP, HTTPS, and many others. You can use it as a command-line downloader or check HTTP headers. There are other functionalities to this tool that are not usually implemented. For example, you can use the following command to get a total response time, in seconds:
$ curl -s -w %{time_total}\\n -o /dev/null https://linuxtechlab.com
Other functionalities of cURL include:
- -s—don’t show the progress meter.
- -w—defines what to display on output when the operation is completed.
- -o—write the output as ‘/dev/null’.
- {time_total}—the total time, in seconds, of the operation. The time values change as you run different tests, therefore you should perform several tests in order to get an average speed.
Use online speed testers
Tools such as Google Speed, or the UNIX wget or fetch Utility can help you to check in real-time the page loading speed.
Wrap Up
Keeping the website loading speed up greatly impacts user experience, ultimately increasing conversion and viewer retention. Implementing the techniques mentioned in this article, you can minimize the loading time as much as possible, so you and your users can focus on the content and message of your website.
--------------------
Author Bio
Gilad David Maayan is a technology writer who has worked with over 150 technology companies including SAP, Samsung NEXT, NetApp and Imperva, producing technical and thought leadership content that elucidates technical solutions for developers and IT leadership.