Help us shape the future of Go! Take the 2026 Go Developer Survey

httpcache

package
v0.17.28 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoCacheEntry = errors.New("httpcache: no cache entry")

Functions

This section is empty.

Types

type RoundTripper

type RoundTripper struct {
	// Transport is the next RoundTripper in the chain. It is used for cache
	// misses and requests that bypass the cache. If nil, http.DefaultTransport
	// is used.
	Transport http.RoundTripper

	// DefaultCacheTTL defines how long an otherwise cacheable response is
	// considered fresh when no expiration time can be derived from its HTTP
	// headers. A non-positive value prevents storing such responses.
	DefaultCacheTTL time.Duration

	// UncacheableVaryHeaders lists request field names for which a response must
	// not be stored when the origin names one of them in Vary. The fields are not
	// ignored: ignoring an origin-provided Vary field would permit an incorrect
	// cache hit. This option is useful for volatile fields such as Signature,
	// Signature-Input or traceparent.
	UncacheableVaryHeaders []string
}

func (*RoundTripper) RoundTrip

func (rt *RoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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