Skip to content

0.5.1

@1amageek 1amageek tagged this 15 Jul 09:20
CachePolicy was a public enum of valid Cache-Control combinations, so
every new combination was a source-breaking case addition for any
downstream exhaustive switch. It is now a struct wrapping a private
directives enum: contradictory states remain unrepresentable, existing
call sites (.none, .noStore, publicCache(seconds:), privateCache(seconds:))
compile unchanged, and new combinations no longer break API.

Adds publicCache(browserSeconds:sharedSeconds:), emitting
"public, max-age=<browser>, s-maxage=<shared>" for deployments where a
shared cache (CDN edge) can be invalidated on demand while browser
copies cannot, so browsers get the short lifetime and edges the long one.
Assets 2
Loading