One excellent tool for helping to diagnose this is
curl along with a
--write-out format and the
If you use the
-I option curl will provide the response headers for each completed request.
-L flag will make sure that curl follows redirects.
-w"@/path/to/format/file.txt" flag will allow you to specify a format file that provides a plethora of information about the final request, including some fantastic timing information. This granular timing information can help you diagnose where in the request process the delay is being introduced.
- Notice that your
time_appconnect time is excessively long? It could
be that your webserver is having an issue with SSL stapling.
- What about a long
time_namelookup? Check to ensure that dns resolution
time_redirect taking forever? Maybe you should check
out what's preventing redirects from working properly.
- etc etc etc
Here is an example format that you can use with curl:
And here is an example of a request to google using that format and the options I explained above:
➜ ~ curl -IL -s -w"@sniff.txt" google.com
HTTP/1.1 301 Moved Permanently
Content-Type: text/html; charset=UTF-8
Date: Mon, 24 Aug 2020 01:24:17 GMT
Expires: Wed, 23 Sep 2020 01:24:17 GMT
Cache-Control: public, max-age=2592000
HTTP/1.1 200 OK
Content-Type: text/html; charset=ISO-8859-1
P3P: CP="This is not a P3P policy! See g.co/p3phelp for more info."
Date: Mon, 24 Aug 2020 01:24:18 GMT
Expires: Mon, 24 Aug 2020 01:24:18 GMT
Set-Cookie: 1P_JAR=2020-08-24-01; expires=Wed, 23-Sep-2020 01:24:18 GMT; path=/; domain=.google.com; Secure
Set-Cookie: NID=; expires=Tue, 23-Feb-2021 01:24:18 GMT; path=/; domain=.google.com; HttpOnly
============= HOST: ==========
======= CONNECTION: ==========
============= FILE: ==========
content_type: text/html; charset=ISO-8859-1
=== TIME BREAKDOWN: ==========
For more information about what you can squeeze out of the curl format configuration, read the
--write-out part of the manual page:
Also of note, I'm not sure if you can do this reliably on Windows. I think it is possible to run curl on Windows, but I've never once attempted to do so so YMMV there. I very highly recommend using a Linux distro instead.