Ogu.AspNetCore.Compressions.Snappy 2.1.0

dotnet add package Ogu.AspNetCore.Compressions.Snappy --version 2.1.0
                    
NuGet\Install-Package Ogu.AspNetCore.Compressions.Snappy -Version 2.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ogu.AspNetCore.Compressions.Snappy" Version="2.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ogu.AspNetCore.Compressions.Snappy" Version="2.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Ogu.AspNetCore.Compressions.Snappy" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ogu.AspNetCore.Compressions.Snappy --version 2.1.0
                    
#r "nuget: Ogu.AspNetCore.Compressions.Snappy, 2.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Ogu.AspNetCore.Compressions.Snappy&version=2.1.0
                    
Install Ogu.AspNetCore.Compressions.Snappy as a Cake Addin
#tool nuget:?package=Ogu.AspNetCore.Compressions.Snappy&version=2.1.0
                    
Install Ogu.AspNetCore.Compressions.Snappy as a Cake Tool

Ogu.AspNetCore.Compressions.Snappy

This library extends ASP.NET Core’s native compression capabilities with snappy compression provider which not included in the core framework

Adding Package

dotnet add package Ogu.AspNetCore.Compressions.Snappy

Usage

Registering provider:

The server decides which compression provider to use based on the client's Accept-Encoding header. For example, if a client sends Accept-Encoding: gzip, br, zstd, snappy, the server will select the first supported encoding in the list.

In the example below, since only the SnappyCompressionProvider is registered, the server will respond using Snappy (snappy) compression.

It is the caller’s responsibility to handle the response correctly. The server includes the actual encoding used in the Content-Encoding header — in this case, it will be snappy.

services.AddResponseCompression(opts =>
{
    opts.Providers.Add<SnappyCompressionProvider>();
    opts.MimeTypes = ResponseCompressionDefaults.MimeTypes;
    opts.EnableForHttps = true;
});

If the client requests encodings that the server does not support (e.g., Accept-Encoding: gzip, br), compression will not occur, and the response will be sent uncompressed.

[!NOTE]
opts.MimeTypes defines which response Content-Types are eligible for compression. In this example, it uses the defaults provided by ResponseCompressionDefaults.MimeTypes (e.g., text/plain, application/json, etc.).

Adding the Middleware

The last step is to add the response compression middleware to the pipeline, so it can automatically handle compression for outgoing responses.

app.UseResponseCompression();

Once added, the server will compress eligible responses based on the client’s Accept-Encoding header and the registered compression providers.

[!IMPORTANT]
Middleware must be registered in the correct order.
For more details, refer to the official middleware documentation.

Links:

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Ogu.AspNetCore.Compressions.Snappy:

Package Downloads
Ogu.AspNetCore.Compressions

This library extends ASP.NET Core’s native compression capabilities with additional options not included in the core framework

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.0 48 4/30/2025
2.0.2 77 4/27/2025
2.0.1 79 4/26/2025
2.0.0 78 4/26/2025