perf: limit cookie parse only on some cookie
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- express, javascript, node.js
- Domain
- backend
Research direction
Start at the cookieParser middleware entry point and review how request Cookie headers are parsed. Check existing option-related tests, then define completion as an option that limits parsing to selected cookies, with a regression test covering the API_TOKEN example.
Written by the indexing model from the issue text.
Description
Hi, in my express I use only 1 cookie (API_TOKEN), but client side send varius cookie eg:
_ga_M9MSXKVJN9=XXXX;
_ga_W98228BE06=XXXX;
_gid=XXXX; _ga=XXXX;
_gcl_au=XXXX;
_ga_5MFMLYZHT2=XXXX;
rxVisitor=XXXX;
_ga_K4Y50QD36K=XXXX;
dtCookie=XXXX;
dtSa=XXXX;
rxvt=XXXX;
API_TOKEN=XXXX;
the _g* cookies are Google Analitycs / Google Tag Manage
the _dt* and rx* cookies are Dynatrace
the API_TOKEN is the only one used by my express!
Parsig all those cookies on each request has a performance impact!
The idea is introduce an option for limit the cookie parsing on a limit numer of cookies, eg.:
app.use(cookieParser({null, {
allowedCookie: ['API_TOKEN']
}}))
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 237
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from expressjs/cookie-parser
-
question
Difficulty 4/5 3-5 days Newbie friendliness 35/100
expressjs/cookie-parser#168 · 5 comments ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
expressjs/cookie-parser#138 ·
-
req.cookies is showing nullPossibly taken @D-393Patel claimed this 372 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
expressjs/cookie-parser#128 ·
-
future question
Difficulty 5/5 Over a week Newbie friendliness 25/100
expressjs/cookie-parser#124 · 7 reactions ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 20/100
expressjs/cookie-parser#122 · 5 comments ·
All issues in expressjs/cookie-parser
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
OWASP/CheatSheetSeries#3018 ·
Maintainers usually reply within 1 day
-
Radix number block generates NaN after switching a negative or decimal number to binary, octal or hexPossibly taken @matthewalberto claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
mit-cml/appinventor-sources#4246 · 1 comment ·
Maintainers usually reply within 1 day
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 83/100
GoogleChrome/modern-web-guidance-src#3675 · 2 comments ·
Maintainers usually reply within 1 day