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

Create URL instance once and pass it through onRequest #1486

Closed
Tracked by #1358
n1ru4l opened this issue Jul 28, 2022 · 0 comments
Closed
Tracked by #1358

Create URL instance once and pass it through onRequest #1486

n1ru4l opened this issue Jul 28, 2022 · 0 comments
Assignees
Milestone

Comments

@n1ru4l
Copy link
Collaborator

n1ru4l commented Jul 28, 2022

Currently, we do a lot of the following in onRequest handlers.

const { pathname: requestPath } = new URL(request.url)

Instead we can pass this as a onRequest parameter:

onRequest({ url }) {
  const { pathname: requestPath } = url
}

This should be a bit more performant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants