Add per-CDP control for Network.setCacheDisabled#2990
Conversation
f5d027d to
b773efa
Compare
|
@staylor thanks for the PR and the issue. I didn't know playwright disable cache when request interception are set. What if we add instead a custom const client = await browser.newBrowserCDPSession();
await client.send('LP.configureCDP', {
disableSetCacheDisabled: true,
}); |
@krichprollsch I'll take a pass at it |
Assisted-By: devx/2fa2960e-76f4-4b6e-b6e6-1419f108f12b
b773efa to
c7850a4
Compare
|
@krichprollsch Implemented—thanks for the suggestion. The PR now adds the per-connection command: const client = await browser.newBrowserCDPSession();
await client.send("LP.configureCDP", {
disableSetCacheDisabled: true,
});The default |
|
thanks! |
Summary
LP.configureCDPwith adisableSetCacheDisabledoptionNetwork.setCacheDisabledwhile the option is enabledUsage
Sending the option as
falserestores the standard handling of subsequentNetwork.setCacheDisabledcommands.Motivation
Automation libraries can send
Network.setCacheDisabled(true)as a side effect of enabling request interception. That makes a configured HTTP cache ineffective even when the caller wants interception and caching to coexist.The custom command provides an explicit, per-connection override without adding a library-specific CLI flag or changing the default cache policy.
Validation
zig fmt --check ./*.zig ./**/*.zigmake testreached the final local link step, which is blocked on this machine by a Nix/macOS framework search-path mismatch; CI provides the authoritative full run