brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: Preserve log in the Network panel keeps requests after a redirect or form submit

Web-Development
~/tips/tip-network-preserve-log-redirects

Network panel > tick "Preserve log" in the toolbar

See the request that caused a redirect instead of an empty list after navigation.

Submit a login form, the page redirects, and the Network panel is empty except for the new page. The POST you wanted to inspect is gone. One checkbox stops DevTools from clearing the list on navigation.

Network panel > tick "Preserve log" in the toolbar
Console > Settings (gear) > tick "Preserve log upon navigation"

With Preserve log on, DevTools keeps all requests across page loads until you switch it off again or clear the list yourself. Now the form POST, the 302 redirect and the page after it are all there, in order. Click the POST to see the form data that was sent and the Location header that the server answered with.

The Console has the same option, which helps when an error is logged just before a page navigates away.

I also find it helpful to follow a login flow across several domains: you see every hop, including cookies being set along the way.

The only downside is forgetting it is on. The list keeps growing over many page loads, and later you are looking at requests from a page you left ten minutes ago and wondering why they are there. Switch it off when you are done, or use the clear button before you start a new test.

Further reading: Chrome DevTools: Network features reference

More Web-Development tips ab -n 200 -c 10 https://example.com/ console.assert(items.length > 0, 'cart is empty', items) document.designMode = "on" function save(item) { Save draft All Web-Development tips (67) All topics

Link