A HAR (HTTP Archive Format) file helps us to track the requests between web browsers and websites. The format of HAR is a JSON-formatted archive file, and the common extension for the files is .har, such file is used by several HTTP session tools to export the captured data. The captured data of each request contains headers, cookies, responses and timings.
HAR files can be used for troubleshooting issues like:
- Performance Issues: slow page load, a timeout when performing a certain task.
- Page rendering: page format, missing information, Dependant code that needs third-party code libraries, Resource-consuming or large CSS files.
The data is stored as a JSON document and extracting meaning from the low-level data is not always easy. But with practice, a HAR file can quickly help you to identify the key performance problems with a web page, letting you efficiently target your development efforts at areas of your site that will deliver the greatest results.
Steps to analyse for Performance issues are:
- Search for the slow responding request.
- Identify what is the longest waiting time, and how long it waited.
- Check what the main contributor towards the delay is.
- Run consistency checking by reloading the page multiple times.
- Seek assistance from the Dev Support team with the information captured if identifying the Server is contributing to the delay.
- Reloading the static resources every time, when the same user revisits the page which effects page loading time.
- Page load times can be decreased either by compressing or removing surplus elements.
- Dependant code that needs third-party code libraries to be loaded before it is run; this can increase the DNS lookup time for these resources thus decreasing the overall speed of your site.
Following are the HTTP session tools which generate HAR:
- Firebug
- Fiddler
- HttpWatch
- Charles Web Proxy
- Mozilla Firefox
- Google Chrome
- Internet Explorer 9
- Microsoft Edge
- Paw
- Restlet Client
As the HAR file contains a lot of information, you can easily determine the root cause and improve website performance. With the abovementioned tools, you can easily create the HAR file and easily access the information.
If you want to get a better visualization of the data, you can use analyser like G Suite Toolbox.