Skip to content

[Blazor] Client side : enable Brotli compression #13002

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

Closed
RemiBou opened this issue Aug 9, 2019 · 5 comments
Closed

[Blazor] Client side : enable Brotli compression #13002

RemiBou opened this issue Aug 9, 2019 · 5 comments
Labels
area-blazor Includes: Blazor, Razor Components question

Comments

@RemiBou
Copy link
Contributor

RemiBou commented Aug 9, 2019

Is your feature request related to a problem? Please describe.

When enabling brotli compression, you can decrease mscorlib.dll from 1,4MB to 647Kb (-54%) and System.Core from 310Kb to 145Kb. This kind of improvement can be seen on many other dll. Given the fact that load time is very important for client side app, this seems like an easy win.

Describe the solution you'd like

Maybe when calling MapFallbackToClientSideBlazor setup brotli and enable compression on "application/octet-stream"

Additional context

On my project Toss the first load went from 4,7MB to 2,7MB.

@RemiBou RemiBou changed the title [Blazor] Client side : enable Brotli compression in templates [Blazor] Client side : enable Brotli compression Aug 9, 2019
@Eilon Eilon added the area-blazor Includes: Blazor, Razor Components label Aug 9, 2019
@mkArtakMSFT
Copy link
Contributor

Thanks for contacting us, @RemiBou.
@Tratcher is there anything we need to do here, or is the compression enabled by default?

@Tratcher
Copy link
Member

Tratcher commented Aug 9, 2019

The blazor template doesn't include the response compression middleware by default.

Brotli support was added back in 2.2 (aspnet/BasicMiddleware#217), and we added application/wasm to the compression list (2d3ad1c).

How is mscorlib.dll being served? Dll's aren't on static file's default list.

application/octet-stream isn't on the default compression list.

@Tratcher
Copy link
Member

Tratcher commented Aug 9, 2019

Ok, that should be everything you need.

@RemiBou you should already be seeing dynamic compression here.

@RemiBou
Copy link
Contributor Author

RemiBou commented Aug 10, 2019 via email

@ghost ghost locked as resolved and limited conversation to collaborators Dec 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components question
Projects
None yet
Development

No branches or pull requests

5 participants