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

httpcache

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleGenericETagPrivateCache

func HandleGenericETagPrivateCache(req *http.Request, w http.ResponseWriter, etag string, lastModified *time.Time) bool

func HandleGenericETagPublicCache

func HandleGenericETagPublicCache(req *http.Request, w http.ResponseWriter, etag string, lastModified *time.Time) bool

func SetCacheControlInHeader

func SetCacheControlInHeader(h http.Header, opts *CacheControlOptions)

SetCacheControlInHeader sets suitable cache-control headers in the response

Types

type CacheControlOptions

type CacheControlOptions struct {
	IsPublic bool
	MaxAge   time.Duration
}

func CacheControlForPrivateStatic

func CacheControlForPrivateStatic() *CacheControlOptions

func CacheControlForPublicStatic

func CacheControlForPublicStatic() *CacheControlOptions

Jump to

Keyboard shortcuts

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