taxum
    Preparing search index...

    Type Alias ResponseCompressionConfig

    type ResponseCompressionConfig = {
        accept?: Set<compression.Encoding>;
        compressionLevel?: CompressionLevel;
        predicate?: Predicate;
    }
    Index

    Properties

    accept?: Set<compression.Encoding>

    Encodings accepted by this layer.

    Defaults to accepting all encodings.

    compressionLevel?: CompressionLevel

    Level of compression data should be compressed with.

    Supports the following pre-defined values:

    • "fastest": fastest quality of compression, usually produces bigger size.
    • "best": best quality of compression, usually produces smallest size.
    • "default": default quality of compression defined by the selected compression algorithm.

    You can also set this value to a number to define a precise quality based on the underlying compression algorithms' qualities.

    The interpretation of this depends on the algorithm chosen and the specific implementation backing it.

    Qualities are implicitly clamped to the algorithm's maximum.

    predicate?: Predicate

    Predicate to decide whether the response should be compressed.

    If not specified, responses will be compressed unless:

    • They're gRPC, which has its own protocol specific compression scheme.
    • It's an image as determined by the content-type starting with image/.
    • They're Server-Sent Events (SSE) as determined by the content-type being text/event-stream.
    • The response is less than 32