Versions in this module Expand all Collapse all v1 v1.1.0 Apr 23, 2026 v1.0.0 Jan 20, 2026 Changes in this version + const BYPASS + var ErrHeaderNoMatchVaryData = errors.New("header no match vary data") + var ErrHeaderNoMatchVaryKey = errors.New("header no match vary key") + var ErrVaryDowngradeNormal = errors.New("vary downgrade to normal cache") + var ErrVarySizeLimited = errors.New("vary size exceed limit") + func Middleware(c *configv1.Middleware) (middleware.Middleware, func(), error) + type Caching struct + func (c *Caching) Key() string + func (c *Caching) Lock() + func (c *Caching) RLock() + func (c *Caching) RUnlock() + func (c *Caching) Unlock() + type Duration string + func (r Duration) AsDuration() time.Duration + type FileChangeOption func(r *FileChangedProcessor) + type FileChangedProcessor struct + func (r *FileChangedProcessor) Lookup(_ *Caching, _ *http.Request) (bool, error) + func (r *FileChangedProcessor) PostRequest(c *Caching, req *http.Request, resp *http.Response) (*http.Response, error) + func (r *FileChangedProcessor) PreRequest(_ *Caching, req *http.Request) (*http.Request, error) + type FillRangeOption func(f *fillRange) + func WithChunkSize(chunkSize uint64) FillRangeOption + func WithFillRangePercent(fillRangePercent int) FillRangeOption + type PrefetchOption func(r *PrefetchProcessor) + type PrefetchProcessor struct + func (r *PrefetchProcessor) Lookup(c *Caching, req *http.Request) (bool, error) + func (r *PrefetchProcessor) PostRequest(c *Caching, req *http.Request, resp *http.Response) (*http.Response, error) + func (r *PrefetchProcessor) PreRequest(c *Caching, req *http.Request) (*http.Request, error) + type Processor interface + Lookup func(caching *Caching, req *http.Request) (bool, error) + PostRequest func(caching *Caching, req *http.Request, resp *http.Response) (*http.Response, error) + PreRequest func(caching *Caching, req *http.Request) (*http.Request, error) + func NewFileChangedProcessor(opts ...FileChangeOption) Processor + func NewFillRangeProcessor(opts ...FillRangeOption) Processor + func NewPrefetchProcessor(opts ...PrefetchOption) Processor + func NewRevalidateProcessor(opts ...RefreshOption) Processor + func NewStateProcessor() Processor + type ProcessorChain []Processor + func NewProcessorChain(processors ...Processor) *ProcessorChain + func (pc *ProcessorChain) Lookup(caching *Caching, req *http.Request) (bool, error) + func (pc *ProcessorChain) PostRequest(caching *Caching, req *http.Request, resp *http.Response) (*http.Response, error) + func (pc *ProcessorChain) PreRequest(caching *Caching, req *http.Request) (*http.Request, error) + func (pc *ProcessorChain) String() string + type RefreshOption func(r *RevalidateProcessor) + type RevalidateProcessor struct + func (r *RevalidateProcessor) Lookup(c *Caching, req *http.Request) (bool, error) + func (r *RevalidateProcessor) PostRequest(c *Caching, req *http.Request, resp *http.Response) (*http.Response, error) + func (r *RevalidateProcessor) PreRequest(c *Caching, req *http.Request) (*http.Request, error) + type StateProcessor struct + func (s *StateProcessor) Lookup(c *Caching, req *http.Request) (bool, error) + func (s *StateProcessor) PostRequest(c *Caching, req *http.Request, resp *http.Response) (*http.Response, error) + func (s *StateProcessor) PreRequest(c *Caching, req *http.Request) (*http.Request, error) + type VaryOption func(r *VaryProcessor) + func WithVaryIgnoreKeys(keys ...string) VaryOption + func WithVaryMaxLimit(limit int) VaryOption + type VaryProcessor struct + func NewVaryProcessor(opts ...VaryOption) *VaryProcessor + func (v *VaryProcessor) Lookup(caching *Caching, req *http.Request) (bool, error) + func (v *VaryProcessor) PostRequest(caching *Caching, req *http.Request, resp *http.Response) (*http.Response, error) + func (v *VaryProcessor) PreRequest(_ *Caching, req *http.Request) (*http.Request, error)