WIP: Add gzip compression#302

Draft
video-prize-ranch wants to merge 2 commits from video-prize-ranch/pages-server:main into main
Contributor

Fixes #223

Responses are compressed with gzip and cached.

Fixes #223 Responses are compressed with gzip and cached.
code review fixes woohoo
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
924ad83ac6
Owner

Thank you for the contribution, I've marked it as "WIP" due to #301 breaking most of the changes, and also because I think that this will still need some discussion specifically on caching of compressed contents.

This is as of now uncovers an existing bug that's unfortunately a DoS vector, as the whole file is loaded at once into memory without a size limit, instead of streaming its contents. #301 will change quite some things that are touched in this PR, including that DoS issue, and then streamed Gzip and caching Gzip-compressed responses and thus saving CPU for often accessed resources should become a lot easier to implement.

Thank you for the contribution, I've marked it as "WIP" due to #301 breaking most of the changes, and also because I think that this will still need some discussion specifically on caching of compressed contents. This is as of now uncovers an existing bug that's unfortunately a DoS vector, as the whole file is loaded at once into memory without a size limit, instead of streaming its contents. #301 will change quite some things that are touched in this PR, including that DoS issue, and then streamed Gzip and caching Gzip-compressed responses and thus saving CPU for often accessed resources should become a lot easier to implement.
momar changed title from Add gzip compression to WIP: Add gzip compression 2024-04-02 00:27:07 +02:00
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline failed
ci/woodpecker/pr/lint
Required
ci/woodpecker/pr/build
Required
This pull request has changes conflicting with the target branch.
  • server/gitea/client.go
  • server/upstream/upstream.go
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u main:video-prize-ranch-main
git switch video-prize-ranch-main
Sign in to join this conversation.
No description provided.