caddy_decompress

package module
v0.0.0-...-7d8e5d6 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

README

caddy-deflate

A caddy plugin that adds support for HTTP's Accept-Encoding: deflate for caddy.

Note: This follows the official definition for http deflate, that being a deflate stream wrapped with zlib, not a raw deflate stream! (many implementations have made this mistake)

Building with xcaddy

xcaddy build \
  --with github.com/rushiiMachine/caddy-deflate

Samples

The encode directive will have a new format named deflate.
Valid compression levels are listed here otherwise any value in the range [0-9].

:80 {
    encode deflate
    file_server
}

or

:80 {
    # Use multiple compressors
    encode deflate gzip zstd

    file_server
}

or

:80 {
    encode {
        # Configure the compression level
        deflate 4
        
        # Configure another backup compressor
        gzip
    }

    file_server
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deflate

type Deflate struct {
	Level int `json:"level,omitempty"`
}

func (Deflate) AcceptEncoding

func (h Deflate) AcceptEncoding() string

AcceptEncoding implements encode.Encoding

func (Deflate) CaddyModule

func (Deflate) CaddyModule() caddy.ModuleInfo

CaddyModule implements caddy.Module

func (Deflate) NewEncoder

func (h Deflate) NewEncoder() encode.Encoder

NewEncoder implements encode.Encoding

func (*Deflate) UnmarshalCaddyfile

func (h *Deflate) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile implements caddyfile.Unmarshaler

func (Deflate) Validate

func (h Deflate) Validate() error

Validate implements caddy.Validator

Jump to

Keyboard shortcuts

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