Contently
Start a conversation

How to Generate a HAR File for Troubleshooting

When investigating website performance issues or diagnosing technical problems, it can be incredibly helpful to generate a HAR (HTTP Archive) file. A HAR file records the network traffic and performance data between your browser and a website. Sharing this file with support or development teams can provide insight into network requests, responses, and load times, allowing them to identify and address issues more efficiently.

Below, you’ll find instructions on how to generate a HAR file in several popular browsers: Google Chrome, Safari, Microsoft Edge, and Mozilla Firefox.


What is a HAR File?

A HAR (HTTP Archive) file is a log of all network requests made by your browser. It includes detailed information such as:

  • The URLs requested
  • Request and response headers
  • HTTP status codes
  • File sizes and load times

Capturing a HAR file is especially useful for pinpointing issues like slow loading times, error messages, and page-rendering problems.


Best Practices for Capturing a HAR File

  1. Close Extra Tabs or Windows
    To capture only the relevant data, close any unnecessary browser tabs or windows before you begin.
  2. Clear Browser Cache (Optional)
    If needed, clear your browser cache to ensure you’re seeing fresh network requests. This helps capture a clean trace.
  3. Preserve Log
    Make sure your browser’s developer tools are set to preserve the log so that data is not cleared when pages reload or switch.
  4. Reproduce the Issue
    Begin recording the HAR file, then reproduce the issue you’re experiencing so that the problematic requests show in the file.
  5. Save the HAR File
    Once you’ve reproduced the issue, save the HAR file so you can review it yourself or share it with the necessary teams for troubleshooting.

Google Chrome

  1. Open Developer Tools
    • Click the three vertical dots in the top-right corner of the Chrome window.
    • Go to More Tools > Developer Tools.
    • Alternatively, you can press Ctrl + Shift + I (Windows) or Command + Option + I (Mac).
  2. Open the Network Tab
    • In the Developer Tools pane, click on the Network tab.
    • Make sure the Preserve log option is checked if you want to capture data across multiple page loads.
  3. Record the Network Activity
    • If it isn’t already recording, click the circle icon in the top-left corner of the Network tab to start recording.
  4. Reproduce the Issue
    • Refresh the page or navigate as needed to reproduce the issue.
  5. Save the HAR File
    • Once you’ve reproduced the issue, right-click inside the network request table and select Save as HAR with Content (or a similarly labeled option).
    • Choose a location on your computer to store the file.
    • Or click the down arrow to download the Har.

 


Apple Safari

  1. Enable the Develop Menu
    • Go to Safari > Preferences.
    • Select the Advanced tab.
    • Check Show Develop menu in menu bar at the bottom.
  2. Open the Network Tab
    • In the menu bar, click Develop > Show Web Inspector.
    • Navigate to the Network tab in the Web Inspector.
  3. Record the Network Activity
    • If necessary, click the record button at the top-left corner of the Network tab.
    • Refresh or load the page to see the requests appear.
  4. Reproduce the Issue
    • Interact with the site to replicate the problem.
  5. Export the HAR File
    • Right-click any entry in the network request log and select the option to export or save.
    • Safari may save the file in the .har format or as a .webarchive. If it’s a .webarchive, you can still share this file for analysis, but if a .har option is available, that’s preferred.

 


Microsoft Edge

  1. Open Developer Tools
    • Click the three horizontal dots in the top-right corner of the Edge browser.
    • Select More Tools > Developer Tools.
    • Or press F12 (Windows) to quickly open Developer Tools.
  2. Go to the Network Tab
    • In the Developer Tools pane, click on the Network tab.
    • Enable Preserve log if necessary.
  3. Start Recording
    • Ensure the record button (circle icon) is active.
    • Refresh or navigate to begin capturing the requests.
  4. Reproduce the Issue
    • Follow the steps that lead to the problem you’re trying to diagnose.
  5. Save the HAR File
    • Right-click inside the network request list, then choose Save as HAR with Content.
    • Pick a location on your computer and save the file.

Mozilla Firefox

  1. Open Developer Tools
    • Click the three horizontal lines in the top-right corner.
    • Select More Tools > Web Developer Tools.
    • Or press Ctrl + Shift + I (Windows) or Command + Option + I (Mac).
  2. Navigate to the Network Tab
    • In the Developer Tools, click on the Network tab.
    • Check Persist Logs if you need to record multiple page loads.
  3. Start Recording
    • If recording isn’t already active, click the record button.
  4. Reproduce the Issue
    • Refresh or navigate through the page to capture the network activity associated with the problem.
  5. Save the HAR File
    • Right-click on the list of network requests and select Save all as HAR.
    • Specify the file name and where you want to save it.

 


Reviewing and Sharing Your HAR File

Once you’ve captured the HAR file, you can either examine it yourself (using built-in tools or third-party HAR viewers) or share it with the relevant support or development team. Make sure that you’re comfortable sharing this level of detail, as the HAR file can include sensitive information such as headers or cookies. If needed, you can edit or redact confidential data before sending the file.


Conclusion

A HAR file is an invaluable resource when trying to diagnose website performance problems or other technical issues. Following the steps outlined above allows you to capture the most relevant network activity. By providing a HAR file along with a detailed description of the issue, you can significantly reduce troubleshooting time and help teams pinpoint the root cause more quickly.

 

    Choose files or drag and drop files
Was this article helpful?
Yes
No

Related articles