-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Enable compression on blazorpack #35897
Comments
@tag5 thanks for contacting us. We've been thinking about this, however there are security implications about turning on websocket compression and dynamic content (CRIME, BREACH and related attacks) and we are still working on understanding the security concerns for Blazor server. Until we have a clear picture we won't make a decision on whether we enable folks to to turn it on and off and whether we turn it on/off by default. |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Thanks for your answer. I think there is an optimization issue in blazorpack. I have tried to inspect messages and volume is very huge. I would like to try to find a solution in order to optimize this.
|
@tag5 we would recommend that you start by using the Virtualize component to minimize the size of the data as a starting point, that will get you far better results than enabling compression. I know there's support for websocket compression added in .NET 6.0, however I'm not familiar with the details on how to operate it. We don't offer extensibility to the Blazor transport protocol, we don't guarantee we won't change it and break it in the future. |
Don't worry about that: I am working with Virtualization components. But it is not enough. |
@tag5 unfortunately I don't think there is a straightforward way. We normally don't operate at that level of abstraction. The best I can think of is to capture the network traffic somehow and run the appropriate pieces through a copy of blazorpack, however I anticipate that's no small feat. |
Okay thanks. |
@tag5 we do care, and we've done due diligence to optimize things where possible and continue to work on it. We simply don't have a ready to go protocol analyzer for going deep into the protocol details, as it is not something we normally need. If you want to get a better understanding of the reasons why your data is so big, I would start by debugging the framework sources alongside your code to understand how many components are being re-rendered on each render batch and the size of the render trees generated by each of those components. |
I don't have source of the third party component. |
Blazorpack is just message pack, in any case you can copy the code from the repo into your own project to parse and inspect any message. |
I have tried to decode with a basic messagepack tool but it was not working. Blazorpack is exactly the same thing than messagepack or are there some specifc implementations ? Thanks |
I believe it's just message pack, with a different protocol name for signalr purposes |
Strange: If you look at BlazorPackHubProtocolWorker.cs, you can see a part of a (de)serialization implementation which does not look like to MessagePack. |
@tag5 no, we don't expose any of the protocol details. Your best bet is to
|
I have tried 2 but impossible to decode; I have tried python msgpack library and i have errors: |
The messagepack payload is prefixed with a length, see https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/HubProtocol.md#binary-encoding for details on how to decode it |
@javiercn : You said i can debug through the ASP.Net Core sources. I have downloaded and compile aspnetcore source code from github. How can i create a blazorserver project and make sure this project is working with my local aspnetcore version instead of nuget ones ? Should i create a project in the same sln than aspnetcore source ? Do you think it is possible to set a breakpoint in aspnetcore source ? Thanks |
Thanks for contacting us. We're moving this issue to the |
I’ve previously attempted (didn’t get very far) creating a Python library for socket-level load testing of Blazor server apps for use with Locust. As far as I know there is no public solution (FOSS or commercial) that appropriately handles persistent WebSockets, is easily able to establish and manage the SignalR session, and appropriately decode and encode blazorpack (msgpack with the payload length leading bytes and multi-part message splitting). Any official assistance, even more complete/consolidated documentation, on the implementation details / spec would be extremely helpful. Without appropriate load testing tools (scalable to hundreds of thousands of sessions - not feasible/economical with browser automation tools like Selenium or Playwright), Blazor Server will remain an unlikely choice for most enterprises - except those that take the time to create their own low-level load testing tools, like I tried (and still need to complete). |
@kulogix I have also tried to put some hooks inside blazor server source code (dotnet core) |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Thanks for contacting us. We're moving this issue to the |
Is your feature request related to a problem? Please describe.
I have inspect websocket messages on a very basic blazorserver application.
I have tried for example to set a textbox value to "Helloworld" when user clicks on a button.
Server sends about 300bytes to browser for applying helloworld to textbox.
I am working with a third party component for a Grid. Displaying 200 rows with 3 text columns costs about 600kbytes.
I have inspect packet and there is a lot of strange data on the top of the packet. I think this can be compressed.
Describe the solution you'd like
Blazorpack only allows text and binary format. I think it will be a good thing to allow on-the-fly compression of blazorpack messages
The text was updated successfully, but these errors were encountered: