storage

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyNegativeTTL added in v1.3.1

func ApplyNegativeTTL(status int, negativeTTL map[int]int, defaultTTL time.Duration) time.Duration

ApplyNegativeTTL - Overrides the TTL for a configured status (e.g. 404/502) with its own short TTL instead of inheriting origin cache headers, which error pages rarely set sanely. This shields the origin from repeated hits on a broken URL.

func PurgeCachedContent

func PurgeCachedContent(ctx context.Context, upstream config.Upstream, rc RequestCallDTO) (bool, error)

PurgeCachedContent - Purges a content in the cache.

func RetrieveCachedContent

func RetrieveCachedContent(ctx context.Context, rc RequestCallDTO, logger *log.Entry) (cache.URIObj, error)

RetrieveCachedContent - Retrives the cached response.

func StoreGeneratedPage

func StoreGeneratedPage(ctx context.Context, rc RequestCallDTO, domainConfigCache config.Cache) (bool, error)

StoreGeneratedPage - Stores a response in the cache.

Types

type RequestCallDTO

type RequestCallDTO struct {
	ReqID       string
	Response    response.LoggedResponseWriter
	Request     http.Request
	CacheObject cache.Object
}

RequestCallDTO - DTO object containing request and response.

Jump to

Keyboard shortcuts

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