Skip to main content
Brotli.NET package icon

Brotli.NET

Supported on dotnet standard2(Windows/Linux/OSX), provide similar interface to Google offical API.Quality and window control is supported. The library use the native runtime and its performance should be better than System.IO.Compress.BrotliStream. To support dynamic compress in web applications,add the code like this in the Global.asax.cs: protected void Application_PostAcquireRequestState(object sender, EventArgs e) { var app = Context.ApplicationInstance; String acceptEncodings = app.Request.Headers.Get("Accept-Encoding"); if (!String.IsNullOrEmpty(acceptEncodings)) { System.IO.Stream baseStream = app.Response.Filter; acceptEncodings = acceptEncodings.ToLower(); if (acceptEncodings.Contains("br") || acceptEncodings.Contains("brotli")) { app.Response.Filter = new BrotliStream(baseStream, System.IO.Compression.CompressionMode.Compress); app.Response.AppendHeader("Content-Encoding", "br"); } //other encodings } }

Total Downloads
3.0M
3,012,298
Published
Feb 22, 2019
Latest stable version

Install

.NET CLI
dotnet add package Brotli.NET --version 2.0.2
Package Manager Console
Install-Package Brotli.NET -Version 2.0.2
PackageReference
<PackageReference Include="Brotli.NET" Version="2.0.2" />

Frameworks

.NETStandard2.0

Dependencies

No declared dependencies.

Adoption guide

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.

Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

How to read this guidance

Sources: published NuGet v3 registry metadata and explicit NuBrowse editorial guides. Refresh: package metadata is refreshed from NuGet when the page loads. Limit: this is not a security, legal or compatibility guarantee; validate the selected version in your project.

Useful next steps

Move from package metadata to a concrete selection or review workflow.