Documentation
¶
Index ¶
- func ApplyNegativeTTL(status int, negativeTTL map[int]int, defaultTTL time.Duration) time.Duration
- func PurgeCachedContent(ctx context.Context, upstream config.Upstream, rc RequestCallDTO) (bool, error)
- func RetrieveCachedContent(ctx context.Context, rc RequestCallDTO, logger *log.Entry) (cache.URIObj, error)
- func StoreGeneratedPage(ctx context.Context, rc RequestCallDTO, domainConfigCache config.Cache) (bool, error)
- type RequestCallDTO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyNegativeTTL ¶ added in v1.3.1
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.