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

cache parsed request body buffer #1356

Open
wants to merge 2 commits into
base: 3.8
Choose a base branch
from
Open

Conversation

elad-yosifon
Copy link

No description provided.

@@ -67,6 +68,9 @@
private Set<FileUpload> fileUploads;
private Session session;
private User user;
private JsonArray parsedBodyAsJsonArray;
private JsonObject parsedBodyAsJson;
private Map<String, String> parsedBodyAsString;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it an overkill to cache all encodings? Why not just cache the default encoding "null" and extract from the buffer other encodings? A new map here will just create gc as I guess most users will not switch encodings during a request that often, wdyt?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pmlopes I'm not sure I understand your point...
I agree that on the same request context, the same encoding will probably be used (on most cases) over and over again.
What do you suggest? removing the cache by encoding map?

@elad-yosifon elad-yosifon requested a review from pmlopes April 23, 2020 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants