Skip to content

Commit

Permalink
Added support for Zstandard compression
Browse files Browse the repository at this point in the history
  • Loading branch information
AnderssonPeter committed Mar 23, 2024
1 parent 7e6aa76 commit 76d6ab0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CompressedStaticFiles/CompressedAlternativeFileProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ public class CompressedAlternativeFileProvider : IAlternativeFileProvider
new Dictionary<string, string>()
{
{ "gzip", ".gz" },
{ "br", ".br" }
{ "br", ".br" },
{ "br", ".br" },
{ "zstd", ".zst" }
};

private readonly ILogger logger;
Expand All @@ -32,6 +34,7 @@ public void Initialize(FileExtensionContentTypeProvider fileExtensionContentType
{
// the StaticFileProvider would not serve the file if it does not know the content-type
fileExtensionContentTypeProvider.Mappings[".br"] = "application/brotli";
fileExtensionContentTypeProvider.Mappings[".zst"] = "application/zstd";
}

/// <summary>
Expand Down
6 changes: 4 additions & 2 deletions CompressedStaticFiles/CompressedStaticFiles.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>2.1.0</Version>
<Version>2.2.0</Version>
<Authors>Peter Andersson;Andrey Kudashkin;Mathias Raacke;Arian Kadkhoda;Ilya Palkin;Mark Preston</Authors>
<Company>Peter Andersson;Andrey Kudashkin;Mathias Raacke;Arian Kadkhoda;Ilya Palkin;Mark Preston</Company>
<Description>Send compressed static files to the browser without having to compress on demand, also has support for sending more advanced image formats when the browser indicates that i has support for it.
Files need to be compressed and converted to other image formats before deploying.</Description>
<PackageProjectUrl>https://github.com/AnderssonPeter/CompressedStaticFiles</PackageProjectUrl>
<PackageTags>aspnetcore;staticfiles;compression;precompressed;gzip;brotli;zopfli;webp;avif;</PackageTags>
<PackageReleaseNotes>2.1.0
<PackageReleaseNotes>2.2.0
Added support for Zstandard compression
2.1.0
Added support for space in filenames
Added support for RequestPath
Added support for .net 6.0
Expand Down

0 comments on commit 76d6ab0

Please sign in to comment.