How-To Generate a HAR file for Liferay Support

HTTP Archive (HAR) files are a format used to track information between a user's browser and site.  It can be used to identify performance issues such as slow load times, page renders, or other bottlenecks.  This is due in part, because the file tracks the load of resources and how long these resources take to load/run.

It is a great diagnostic tool that Liferay Support may occasionally request.  The following are steps that can be used to generate HAR files depending on the browser being used.

NOTE: Liferay Support does not recommend or endorse specific third-party products over others. The information provided about products not created by Liferay is for reference purposes only, and any implementation of these principles will be at your team's discretion.

Resolution

Chrome

  1. Open "developer tools" using one of these methods:
    • Keyboard Shortcut: 
      • OS X: ⌘⌥I
      • Linux: Ctrl + Shift + i
      • Windows: F12
    • Chrome Menu:
      • Click on the three dots icon on Chrome at the upper-right of the browser window, select Tools > Developer Tools.
  2. Navigate to the Network tab on the Development Tool
  3. Check Disable Cache option to prevent caching of resources for the page.
  4. Refresh the page to begin capturing the traffic between the browser to the server.

    Note: Please capture a full page load so we can review the requests made prior to the behavior.

  5. Attempt/Perform the steps that demonstrate or trigger the issue.
  6. Right Click the network records area, selecting "Save as HAR with content"
  7. Before sending the HAR file to Liferay Support, be sure to remove/redact any sensitive information such as any passwords or secrets.

 

Firefox

  1. Go to Tools > Web Developer > Network
  2. Refresh the page to begin capturing the traffic between the browser to the server.

    Note: Please capture a full page load so we can review the requests made prior to the behavior.

  3. Attempt/Perform the steps that demonstrate or trigger the issue.
  4. Click on Export followed by Save As... to save the HAR file
  5. Before sending the HAR file to Liferay Support, be sure to remove/redact any sensitive information such as any passwords or secrets.

 

Internet Explorer

Internet Explorer does not natively provide a HAR output file.  As such, a third-party program such as HTTPWatch can also be used instead:

  • Download and Install HttpWatch.
  • Start HttpWatch capture before reproducing the issue.
  • Stop the HttpWatch capture after reproducing the issue.
  • Export the capture to HAR format.

 

Edge

  1. Use the F12 keyboard shortcut to access "Developer Tools"
  2. Refresh the page to begin capturing the traffic between the browser to the server.

    Note: Please capture a full page load so we can review the requests made prior to the behavior.

  3. Attempt/Perform the steps that demonstrate or trigger the issue.
  4. Click on Export as HAR (Floppy button next to the stop button in Developer Tools) followed by Save As... to save the HAR file.
  5. Before sending the HAR file to Liferay Support, be sure to remove/redact any sensitive information such as any passwords or secrets.

 

Safari

  1. Go to Developer tools and choose "Start Recording Timeline".
  2. Select timeline all instruments to record.
  3. Refresh the page to begin capturing the traffic between the browser to the server.

    Note: Please capture a full page load so we can review the requests made prior to the behavior.

  4. Attempt/Perform the steps that demonstrate or trigger the issue.
  5. Click on Save. (The circle with the down arrow.)

Sanitize

  1. Go to https://har-sanitizer.pages.dev/
  2. Upload the HAR file previously generated
  3. Select which elements you would like sanitized from the HAR file:

Cookies

  • COMPANY_ID
  • ID
  • JSESSIONID
  • LOGIN
  • PASSWORD
  • USER_UUID

Headers

  • Authorization
  • Cookie
  • LIFERAY_EMAIL_ADDRESS
  • LIFERAY_SCREEN_NAME
  • LIFERAY_USER_ID
  • Set-Cookie
  • WWW-Authenticate
  • x-csrf-token

Mime Types

  • text/html

Data that cannot be sanitized by Cloudflare’s HAR Sanitizer

  • postData

4. Click Download Sanitized HAR.

 

Additional Information

¿Fue útil este artículo?
Usuarios a los que les pareció útil: 2 de 2