compress

package
v0.1.149 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package compress provides pure functions for content encoding negotiation and compression decision making.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NegotiateEncoding

func NegotiateEncoding(acceptEncoding string) string

NegotiateEncoding selects best encoding from Accept-Encoding header. Preference: brotli > gzip > identity (no encoding).

func ShouldCompressContentType

func ShouldCompressContentType(contentType string) bool

ShouldCompressContentType checks if content type should be compressed.

func ShouldCompressPath

func ShouldCompressPath(path string) bool

ShouldCompressPath checks if path extension should be compressed. Returns true if path should be compressed, false if it should not.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL