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

feat(middleware): Add a MaxBodyBytes configuration option #442

Merged
merged 4 commits into from
Feb 12, 2024

Conversation

vejipe
Copy link
Collaborator

@vejipe vejipe commented Jan 24, 2024

Add a MaxBodyBytes configuration option in order to limit cached response body size in Upstream/Revalidate requests.

@vejipe vejipe marked this pull request as draft January 24, 2024 14:50
@vejipe vejipe force-pushed the feat/middleware/add-max-bytes-to-writer branch 5 times, most recently from 007ddff to e19070e Compare January 26, 2024 10:27
@vejipe vejipe changed the title feat(middleware): Add a MaxBytes option to CustomWriter feat(middleware): Add a MaxBodyBytes configuration option Jan 26, 2024
@vejipe vejipe force-pushed the feat/middleware/add-max-bytes-to-writer branch from e19070e to 195b0e0 Compare January 26, 2024 13:58
@darkweak darkweak marked this pull request as ready for review February 10, 2024 12:40
@darkweak darkweak force-pushed the feat/middleware/add-max-bytes-to-writer branch from 969e381 to 5f6b06e Compare February 10, 2024 12:42
@vejipe
Copy link
Collaborator Author

vejipe commented Feb 12, 2024

General questions:

  • Do we want to rename the config option max_cachable_body_bytes to make it clear that its value only refers to bodies stored in cache, not a body going through Souin uncached?
  • Corollary: do we want another max_body_bytes that refers to any body coming from upstream. Because currently, the upstream body is first completely copied in RAM and that will because an issue if the content is very large (e.g., several GB video file). Or maybe CustomWriter can be refactored to stream the upstream content and then max_body_bytes would become the maximum body chunk kept in RAM before streaming is engaged?

@darkweak
Copy link
Owner

Second point will be handled in a future PR.

@darkweak darkweak merged commit 5860dd7 into master Feb 12, 2024
18 checks passed
@darkweak darkweak deleted the feat/middleware/add-max-bytes-to-writer branch March 2, 2024 00:02
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

Successfully merging this pull request may close these issues.

None yet

2 participants