Skip to content

Commit

Permalink
Fix br compression size regression in Blazor WASM (#27659)
Browse files Browse the repository at this point in the history
Reacting to dotnet/runtime#72266, which changed CompressionLevel.Optimal to no longer mean "smallest size", but instead a balance between compression speed and output size. In Blazor WASM publishing, we really want smallest size - it is preferred to spend more time during publish in order for less bytes to be downloaded and cached in the browser.

The fix is to change the default compression level to SmallestSize in the brotli tool used by WASM publish.
  • Loading branch information
eerhardt authored Sep 6, 2022
1 parent 4b66360 commit a8e9c11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/BlazorWasmSdk/Tool/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static int Main(string[] args)

var compressionLevelOption = new Option<CompressionLevel>(
"-c",
getDefaultValue: () => CompressionLevel.Optimal,
getDefaultValue: () => CompressionLevel.SmallestSize,
description: "System.IO.Compression.CompressionLevel for the Brotli compression algorithm.");
var sourcesOption = new Option<List<string>>(
"-s",
Expand Down

0 comments on commit a8e9c11

Please sign in to comment.