Versions in this module Expand all Collapse all v14 v14.0.1 Nov 13, 2026 v14.0.0 Nov 12, 2026 Changes in this version + func PathPrefix(r *http.Request) string + type Cache struct + Options *Options + func Must(options Options) *Cache + func New(options Options) (*Cache, error) + func (c *Cache) Close() error + func (c *Cache) ContextKey(ctx *context.Context) string + func (c *Cache) CountAll(ctx context.Context) (int, error) + func (c *Cache) CountPrefix(ctx context.Context, prefix string) (int, error) + func (c *Cache) Get(ctx context.Context, key string) (Response, bool, error) + func (c *Cache) GetResponse(ctx context.Context, r *http.Request) (Response, bool, error) + func (c *Cache) Handler() context.Handler + func (c *Cache) Invalidate(ctx context.Context, key string) error + func (c *Cache) InvalidateAll(ctx context.Context) (int, error) + func (c *Cache) InvalidateHandler(prefixes ...string) context.Handler + func (c *Cache) InvalidatePrefix(ctx context.Context, prefix string) (int, error) + func (c *Cache) InvalidateRequest(ctx context.Context, r *http.Request) error + func (c *Cache) InvalidateRoutes(r router.Router) context.Handler + func (c *Cache) Pair(r router.Router) (context.Handler, context.Handler) + func (c *Cache) RequestKey(r *http.Request) string + func (c *Cache) Set(ctx context.Context, key string, response Response) error + func (c *Cache) SetResponse(ctx context.Context, r *http.Request, response Response) error + type Options struct + Addr string + CommandTimeout time.Duration + Cookies []string + Disable bool + Headers []string + NoBody bool + NoQuery bool + Password string + StartupCleanup bool + TTL time.Duration + type Response struct + Body []byte + ExpiresAt time.Time + Headers http.Header + func (r *Response) WriteTo(w http.ResponseWriter) error