Skip to content

Reuse header value strings across requests #8372

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

Closed
benaadams opened this issue Mar 9, 2019 · 1 comment
Closed

Reuse header value strings across requests #8372

benaadams opened this issue Mar 9, 2019 · 1 comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Comments

@benaadams
Copy link
Member

Is your feature request related to a problem? Please describe.

For each request from the browser a lot of repeated headers are sent that are identical to the previous request.

This results in a lot of string allocations, especially for Accept, Cookie and User-Agent e.g.

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Cache-Control: no-cache
Connection: keep-alive
Cookie: (**redacted up to 2KB of data**)
Host: github.com
Pragma: no-cache
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36

Describe the solution you'd like

The previous request has already materialized these values as strings, so they could be reused rather than allocating new strings.

Additional context

Tracking issue

In March 5th, 2019's ASP.NET Community Standup, @DamianEdwards expressed that he thought this was already happening; then continued to suggest that in a future version it would be important to continue to reduce memory used for headers.

/cc @davidfowl

@valeriob
Copy link

Hi, how does it relate to http2 header compression ?

@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

No branches or pull requests

4 participants