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

Brotli Compression Issue #42

Closed
Xeio opened this issue Nov 22, 2022 · 4 comments
Closed

Brotli Compression Issue #42

Xeio opened this issue Nov 22, 2022 · 4 comments

Comments

@Xeio
Copy link

Xeio commented Nov 22, 2022

I think there may be an issue with the Brotli compression on version 2.2.1 (I haven't tried most of the versions between 1.8.5 and 2.2.1). I didn't notice till recently since I'm deployed behind Cloudflare and they seem to request the uncompressed asset generally.

This was specifically trying to access the /_framework/blazor.boot.json file, though I didn't really try with others since that's the first one to fail in the load process.

If I try and use Postman with "Accept-Encoding": "gzip, deflate, br" the request returns a 200 OK but a zero-length file. Works fine if I request after removing "br" in which case I get back a gzip encoding, and also works fine with no Accept-Encoding in which case I get back a non-compressed file.

Not entirely sure why this blows up like it does, I'm guessing Kestrel isn't liking the file for some reason? This is on .Net 7 (running on a Linux docker container from the standard MS containers) for reference as well. No errors logged anywhere that I can tell in either my host container on the Nginx proxy in front of it.

@stavroskasidis
Copy link
Owner

There was a brotli compression bug in 2.2.0 when publishing from a non-windows device. It should work in 2.2.1, did you properly update both projects? (server/client).

When you publish the project locally, does the blazor.boot.json.br file have contents or is it zero-length file?

@Xeio
Copy link
Author

Xeio commented Nov 23, 2022

Ah, so that's interesting, I published to folder everything seemingly works correctly, I get a non-zero length file (Visual Studio 2022 publish to folder on Windows).

But inside my docker container (published using VS on the same system) it looks like this:

root@b7a56d3250df:/app/wwwroot/_framework# ls -hl blazor.boot*
-rw-r--r-- 1 root root 9.5K Nov 20 20:55 blazor.boot.json
-rw-r--r-- 1 root root    0 Nov 20 20:55 blazor.boot.json.br
-rw-r--r-- 1 root root 4.4K Nov 20 20:55 blazor.boot.json.gz

I'm pretty much just using the default docker file for Asp Core, the only thing I've modified about it is the version tag of the image when I moved to the 7.0 SDK.

Also this is the upgrade commit for reference, both server and client upgraded to 2.2.1.

@stavroskasidis
Copy link
Owner

Please try using version 2.3.0-beta, it should be fixed.
For more info see issue #36

@stavroskasidis
Copy link
Owner

Closing as it should be fixed with 2.3.0. Please reopen if you still have an issue.

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

No branches or pull requests

2 participants