Add server capability to check for Brotli compressed static files#8063
Add server capability to check for Brotli compressed static files#8063webknjaz merged 21 commits intoaio-libs:masterfrom
Conversation
|
I think this one should be safe for backport. |
bdraco
left a comment
There was a problem hiding this comment.
Thanks for the PR. Please see comments above
|
@bdraco I'd suggest this should only go to 3.10 backport. We try to stick to bug fixes in the patch releases. |
This comment was marked as resolved.
This comment was marked as resolved.
This reverts commit b0d58f7.
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
webknjaz
left a comment
There was a problem hiding this comment.
Blockers so far:
- new binary blob in Git
- formatting changes in tests
Please, deal with this to making this mergeable.
This reverts commit 634bf94.
Looks like all of my comments have been resolved so that leaves #8063 (review)
Backport to 3.10: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply dfc9296 on top of patchback/backports/3.10/dfc92967d10eb83a8d726c02c3de90da15f8335f/pr-8063 Backporting merged PR #8063 into master
🤖 @patchback |
|
@steverep looks like cherry-pick still has conflicts that need to be addressed manually. Please submit a backport PR per instructions above. |
…les (aio-libs#8063) Currently server only checks if static routes have a `.gz` extension and serves them with `gzip` encoding. These changes do the same for `.br` files with `br` encoding. Brotli is prioritized over gzip if both exist and are supported by the client, as it should almost always be a smaller content length. I considered making a check for which is smaller if both exist, but figured it wouldn't be worth the extra file system call in the vast majority of cases (at least not for typical web formats). Users should simply use gzip if it's smaller than Brotli for any file. Resolves aio-libs#8062 (cherry picked from commit dfc9296) Co-authored-by: Steve Repsher <[email protected]> Co-authored-by: J. Nick Koston <[email protected]> Co-authored-by: Sviatoslav Sydorenko <[email protected]>
What do these changes do?
Currently server only checks if static routes have a
.gzextension and serves them withgzipencoding. These changes do the same for.brfiles withbrencoding. Brotli is prioritized over gzip if both exist and are supported by the client, as it should almost always be a smaller content length.I considered making a check for which is smaller if both exist, but figured it wouldn't be worth the extra file system call in the vast majority of cases (at least not for typical web formats). Users should simply use gzip if it's smaller than Brotli for any file.
Are there changes in behavior for the user?
Only change would be if users are already including
.brfiles, then obviously those would start being served, but IMO that's not "breaking" since the content should be the same.Related issue number
Fixes #8062
Checklist
CONTRIBUTORS.txtCHANGESfolder<issue_id>.<type>for example (588.bugfix)issue_idchange it to the pr id after creating the pr.feature: Signifying a new feature..bugfix: Signifying a bug fix..doc: Signifying a documentation improvement..removal: Signifying a deprecation or removal of public API..misc: A ticket has been closed, but it is not of interest to users.