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

docs: Update features-pre-compression.md #704

Merged
merged 1 commit into from
Apr 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions doc/features-pre-compression.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,25 @@ Pre-compression has two modes:

The parameters for the pre-compression are as follows:
- `WasmShellGenerateCompressedFiles` which can be `true` or `false`. This property is ignored when building `MonoRuntimeDebuggerEnabled` is set to `true`, and `true` by default when the `Configuration` property is set to `Release`
- `WasmShellCompressedExtension` is an item group which specifies which files to compress. By default `wasm`, `clr`, `js`, `css` and `html` files are pre-compressed. More files can be added as follows:
- `WasmShellCompressedExtension` is an item group which specifies which files to compress. By default, the `wasm`, `clr`, `js`, `json`, `css`, `html`, `dat`, `ttf`, and `txt` files are pre-compressed. More files can be added as follows:
```xml
<ItemGroup>
<WasmShellCompressedExtension Include=".db"/>
</ItemGroup>
```
- `WasmShellBrotliCompressionQuality` which controls the compression quality used to pre-compress the files. The default value is 7.
- `WasmShellBrotliCompressionQuality` which controls the compression quality used to pre-compress the files. Possible values are in the range from `0` to `11`. The default value is `7`.
> [!WARNING]
> Two-digit compression quality values (`10` and higher) are intended for extra-intensive CPU usage and can significantly slow down build time.
- `WasmShellCompressionLayoutMode` which can be set to `InPlace` or `Legacy`. If not set and for backward compatility reasons, `Legacy` is automatically selected if a `web.config` file is detected in the layout, and contains the `_compressed_br` string.

#### Support for in-place compression

This mode is to be preferred for web servers that support `accept-encoding` header file rewriting. In the case of [**Azure Static WebApps**](https://docs.microsoft.com/en-us/azure/static-web-apps/get-started-portal), if a file next to the original one is suffixed with `.br`, and the client requested for brotli compressed files, the in-place compressed file will be served.
> [!NOTE]
> To achieve the same behavior in a standalone ASP.NET Core application the [CompressedStaticFiles](https://github.com/AnderssonPeter/CompressedStaticFiles) third-party library can be used.

#### Support for IIS / Azure WebApp GZip/Brotli pre-compression

#### Support for IIS / Azure Webapp GZip/Brotli pre-compression
The IIS compression support has too many knobs for the size of generated WebAssembly files, which
makes the serving of static files inefficient.

Expand Down