-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Improve vfsgen to not unzip bindata files but send to browser directly #7109
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7109 +/- ##
==========================================
- Coverage 42.37% 42.36% -0.02%
==========================================
Files 726 726
Lines 77839 77847 +8
==========================================
- Hits 32982 32976 -6
- Misses 39447 39460 +13
- Partials 5410 5411 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like replication of modules/gzip. How come we can't use that?
Why are we adding another external dependency?
0732e50
to
0b38ed2
Compare
This is different. See my update on PR content. |
What if the client does not support |
Also I'd suggest dropping |
Good idea!!! All done except to support |
func parseAcceptEncoding(val string) map[string]bool { | ||
parts := strings.Split(val, ";") | ||
var types = make(map[string]bool) | ||
for _, v := range strings.Split(parts[0], ",") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about whitespace? E.g. Accept-Encoding: gzip, deflate, br
? A test would be nice.
Maybe you can also copy the docs update regarding |
@silverwind Done. |
Fixed. |
That's fine. Most clients will support gzip and will get the fast path without decompression. |
make L-G-T-M work. |
Improve the embedded vfsgen, should fix #7107
UPDATE: 2020.12.23
Currently, all bindata files stored on binary with compressed bytes, when serve for http request, Gitea creates a zipReader and unzip them for the web browser. If we enabled gzip, then the file will be compressed again and sent to the browser.
But in fact, it's unnecessary. We can just send the compressed files to browser directly. It will spend less cpu and memory than before.