C# utility handling content negotiation and compression for S3 object responses while preserving byte ranges. Reuse when optimizing S3 data plane responses.
// Source: https://github.com/AIDotNet/Means | License: MIT | Copyright 2026 Means contributors
// Provided via justclaw.it.com; keep this notice with the code.
namespace Means.Protocol.S3;
/// <summary>
/// Implements static-object content negotiation for the S3 data plane.
/// Compression is resolved inside the object response writer instead of using a global
/// middleware so Range requests can always receive the original byte representation.
/// </summary>
public static class S3Compression
{
private static readonly HashSet<string> CompressibleTypes = new(StringComparer.OrdinalIgnoreCase)
{
"application/javascript",
"application/json",
"application/xml",
"image/svg+xml",
"text/css",
"text/html",
"text/javascript",
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key