Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress pauses every single request in CDP/Web Extension Unnecessarily #26620

Closed
AtofStryker opened this issue Apr 28, 2023 · 1 comment · Fixed by #26623
Closed

Cypress pauses every single request in CDP/Web Extension Unnecessarily #26620

AtofStryker opened this issue Apr 28, 2023 · 1 comment · Fixed by #26623

Comments

@AtofStryker
Copy link
Contributor

AtofStryker commented Apr 28, 2023

Current behavior

Currently in Electron, Chrome, and Firefox, Cypress pauses every single request coming from the app to determine if the frame making the request is the AUT frame. This is really only needed to happen on ResourceType document requests. We have some data to suggest that possibly not pausing on every single request entering CDP/Web extension might improve performance of general network timings in the form of reducing blocking time.

Desired behavior

Cypress requests should only be paused if the request being made is a document request. This scope of work does not include support for electron as an electron upgrade is needed to support web filters (see issue #26621)

Right now, our invocation of Fetch.RequestPaused takes in every single request from the browser. However, the method Fetch.Enable takes an optional RequestPattern. For the use of cy.origin(), Cypress really only needs to intercept Document resourceType, which should greatly reduce the amount of intercepted requests and hypothetically would reduce blocking time.

Fetch.Enable is really the chromium mechanism we use to pause requests, but we leverage other methods in Electron and Firefox to accomplish the same thing. The good thing for us is that these methods, like onBeforeSendHeaders in electron, takes a WebRequestFilter option, and the extension method for Firefox also takes a RequestFilter, so we should be able to implement very similar logic across our supported browsers.

Test code to reproduce

N/A. enable browser CDP debug logs to see every inbound request in the pause handler

Cypress Version

12.11

Node version

v16.16.0

Operating System

macOS 12.6

Debug Logs

No response

Other

No response

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Aug 1, 2023

Released in 12.17.3.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v12.17.3, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Aug 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant