etag

package
v0.84.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auto

func Auto(config ...*Config) func(http.Handler) http.Handler

Simple, automatic, and conservative ETag middleware that handles (1) setting ETags on GET and HEAD requests and (2) returning 304 responses as appropriate based on a request's If-None-Match header. Defaults to weak ETags, but can be configered to set strong ETags. ETags are determined by buffering and hashing the response body.

Types

type Config

type Config struct {
	Strong      bool
	Hash        func() hash.Hash
	MaxBodySize int64
	SkipFunc    func(r *http.Request) bool
}

Jump to

Keyboard shortcuts

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