Netraptor

Preserve log in Chrome: keep network requests after a page reload

Updated · 6 min read

To keep network requests after a page reload in Chrome, open DevTools, go to the Network panel and check Preserve log in the action bar at the top. Chrome then stops clearing the request list when the page reloads or navigates, so the requests from before a redirect or a login stay visible. In Firefox the same option is called Persist Logs and lives in the Network Monitor's settings menu.

Steps

  1. 1

    Open DevTools

    Press F12, Ctrl+Shift+I on Windows and Linux, or Cmd+Option+I on macOS. Do this before you load the page you want to inspect, because Chrome only records requests while DevTools is open.

  2. 2

    Go to the Network panel

    Click the Network tab. The action bar at the top holds the record and clear buttons, Preserve log, Disable cache and the throttling menu.

  3. 3

    Check Preserve log

    Tick the Preserve log checkbox. From now on, reloads and navigations add to the list instead of replacing it.

  4. 4

    Reproduce the problem

    Reload the page, submit the form or follow the redirect that was wiping your requests. Every request stays in the list, oldest at the top.

  5. 5

    Export before you close DevTools

    The preserved log lives only in the open DevTools window. To keep it, click the Export HAR button in the action bar, or right-click any request and pick one of the Save all as HAR options.

Why the Chrome Network tab clears on navigation

By default the Network panel shows one page at a time. Each time the main frame loads a new document, from a reload, a link, a form post or a server redirect, Chrome clears the list and starts over. That keeps the table short, but it throws away exactly the requests you need when debugging a login flow, an OAuth redirect or a form that posts and then redirects.

Chrome's Network features reference documents the checkbox under "Save requests across page loads". The Console has a separate Preserve log option in its own settings, so check both if you also want console messages to survive a reload.

What Preserve log does and does not keep

Preserve log stops the clear on navigation. It does not change what DevTools records or how long it keeps it. These limits catch most people out:

  • The log is gone when you close DevTools. Closing the DevTools window or the tab loses it. Export a HAR file first if you need the requests later.
  • Requests that happened before you opened DevTools are missing. Chrome records network requests only while DevTools is open, so the first page load is lost unless you reload with DevTools already open.
  • Everything ends up in one flat list. Chrome does not mark where one page load ends and the next begins, so after five reloads it is hard to tell which /api/me call belongs to which load. You have to work it out from the order of the document requests and the Waterfall.
  • Single-page-app route changes never clear the log in the first place. A history.pushState route change is not a document load, so with or without Preserve log every route's API calls pile into the same list with no marker between them.

Preserve log and Disable cache together

Disable cache sits next to Preserve log and is often used with it. When checked, Chrome skips the HTTP cache for every request while DevTools is open, so a reload shows what a first-time visitor downloads. The Chrome docs describe it as a way to emulate a first-time visitor.

The two settings do different jobs. Preserve log controls whether the list survives a reload. Disable cache controls whether the requests in that list hit the network or come from the cache. If a request you expected is missing after a reload, check whether it was served from the memory or disk cache before assuming it never ran.

How to persist logs in Firefox

Firefox has the same feature under a different name. The Firefox Network Monitor docs note that the request list is cleared each time you navigate to a new page or reload by default.

  • Open the Network Monitor with Ctrl+Shift+E on Windows and Linux, or Cmd+Option+E on macOS.
  • Click the gear icon at the right end of the Network toolbar.
  • Select Persist Logs. Requests now stay in the list across reloads and navigations.

The Web Console has its own Persist Logs option in its settings menu. Firefox's version has the same limits as Chrome's: the list lives only while the toolbox is open, and nothing separates one page load from the next.

Doing this with Netraptor

Netraptor is a Chrome extension that adds a Netraptor panel to DevTools. It works like the Network panel but keeps requests across reloads by default and labels every page load.

  • Open the Netraptor panel and it pulls in the requests DevTools has already logged for the current page, so you do not need to reload first.
  • Every reload or navigation starts a new group headed Reloaded or Navigated to, with the page path, the time and the number of requests it made. You can see at a glance which load a request came from.
  • Single-page-app route changes through pushState, replaceState and the back and forward buttons also start a new group. Hash-only changes such as #top do not.
  • Earlier page loads fold away when the page loads again, the way Chrome clears its list, but nothing is deleted. Click a group to expand it, or Alt-click to expand every earlier load. Check Netraptor's own Preserve log box to keep them all open.
  • Clear (Cmd/Ctrl+L) hides earlier requests from the view without deleting them, so exports and the API Map still see everything.

Live capture stays in memory and holds the newest 5,000 requests. Like Chrome's log, it is gone when you close DevTools.

For requests you want to keep, turn on Keep history for this site in the toolbar popup or the History pill in the panel. Netraptor then saves that site's fetch and XHR calls to IndexedDB in your browser and keeps capturing with DevTools closed. Saved sessions keep their page-load groups and appear in the session picker next to the live one. Keep history saves API calls only, not scripts, styles or images. The Free plan keeps the last three sessions and Pro keeps all of them.

When you need to share a session, export it as a HAR file. See what a HAR file is and how to find every API endpoint of a web app for the next steps.

Frequently asked questions

How do I keep network requests after a page reload in Chrome?
Open DevTools, go to the Network panel and check Preserve log in the action bar. Chrome then keeps every request across reloads and navigations until you close DevTools.
Why does the Chrome Network tab clear on navigation?
By default Chrome shows requests for the current page only and clears the list each time the main frame loads a new document. Preserve log turns that off.
Does Preserve log keep requests after closing DevTools?
No. The log exists only while DevTools is open. Export a HAR file before closing DevTools, or use a tool that saves requests to disk.
Where is Persist Logs in Firefox?
In the Network Monitor, click the gear icon at the right end of the toolbar and select Persist Logs. The Web Console has a separate Persist Logs option in its own settings.
Why are some requests missing even with Preserve log on?
Chrome records only while DevTools is open, so anything from before you opened it is missing. Requests served from the cache may also look different. Reload with DevTools open, and check Disable cache if you need every request to hit the network.
Does Preserve log work with single-page apps?
SPA route changes made with history.pushState never clear the Network log, so Preserve log is not needed for them. The catch is that Chrome shows no marker between routes, so every route's API calls land in one list.