In this article, we’ll cover two methods through which you can easily test your website loading speed and some other performance factors like Lookup Time, Connect Time, Pre-Transfer Time and Start-Transfer Time.
To start with first method, we’ll use CURL command which is one of the best tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP). The command is designed to work without user interaction.
For HTTP Websites – (View code)
Command: curl -s -w ‘Website Response Time for :%{url_effective}\n\nLookup Time:\t\t%{time_namelookup}\nConnect Time:\t\t%{time_connect}\nPre-transfer Time:\t%{time_pretransfer}\nStart-transfer Time:\t%{time_starttransfer}\n\nTotal Time:\t\t%{time_total}\n’ -o /dev/null http://www.google.com
For HTTPS Websites – (View Code)
Command: curl -s -w ‘Website Response Time for :%{url_effective}\n\nLookup Time:\t\t%{time_namelookup}\nConnect Time:\t\t%{time_connect}\nAppCon Time:\t\t%{time_appconnect}\nRedirect Time:\t\t%{time_redirect}\nPre-transfer Time:\t%{time_pretransfer}\nStart-transfer Time:\t%{time_starttransfer}\n\nTotal Time:\t\t%{time_total}\n’ -o /dev/null https://www.yeahhub.com
As you can see that the above command syntax is too long and very difficult to remember, so you can also use the above method with an ease way in which you just need to create a “content.txt” file and embed the following content into it and save it.
Code: (View Code)
Website Response Time for :%{url_effective}\n\nLookup Time:\t\t%{time_namelookup}\nConnect Time:\t\t%{time_connect}\nPre-transfer Time:\t%{time_pretransfer}\nStart-transfer Time:\t%{time_starttransfer}\n\nTotal Time:\t\t%{time_total}\n
Now run the following command in your Linux terminal.
Command: curl -s -w “@content.txt” -o /dev/null https://www.yeahhub.com
Curl also offers a busload of useful tricks like proxy support, user authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer resume, Metalink, and more.
The second method is with HTTPSTAT tool which is a single file Python script that has no dependency and is fully compatible with Python 3.
There are many ways to install this tool:
- From Github:
Command: git clone https://github.com/reorx/httpstat - With Wget:
Command: wget https://raw.githubusercontent.com/reorx/httpstat/master/httpstat.py - Through pip:
Command: pip install httpstat - Through Homebrew (Mac):
Command: brew install httpstat - For Windows Version:
Github Link – https://github.com/davecheney/httpstat
To use Httpstat, type “python httpstat.py https://www.yeahhub.com/”
You can see in the above image an ASCII table displaying how long each process took, and for me the most important step is “server processing”.
With the help of Httpstat, you can easily test your website performance and optimize it according to your need.
You may also like:- Most Common DNS Record Types and Their Roles
- Top Skills Needed to Become a Cybersecurity Analyst
- Mastering Windows Management with WMIC Commands – Top 20 Examples
- Edit and Compile Code with the Best 5 Code Editors
- 50+ Top DevSecOps Tools You Need To Know
- Learn How to Add Proxy and Multiple Accounts in MoreLogin
- Some Useful PowerShell Cmdlets
- Create Free SSL Certificate – ZEROSSL.COM [2020 Tutorial]
- Generate Self-Signed SSL Certificate with OPENSSL in Kali Linux
- RDP – CredSSP Encryption Oracle Remediation Solution 2020