httpcache

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0 modules, 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

Overview

Package httpcache holds the dependency-free pieces of HTTP validator caching shared by the SPA handler and the format handlers: If-None-Match evaluation and Cache-Control construction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheControl

func CacheControl(shared bool, maxAgeSeconds int) string

CacheControl builds the Cache-Control value of a response that is revalidated with a validator. A response that only an anonymous caller with read access to a public repository could have received may be stored by shared caches; everything else is private to the requesting client and must be revalidated on every use. maxAgeSeconds <= 0 means "always revalidate".

func ETagMatches

func ETagMatches(header, etag string) bool

ETagMatches reports whether an If-None-Match header value matches etag using the weak comparison RFC 9110 prescribes for If-None-Match: the W/ prefix is ignored and "*" matches any current representation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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