Skip to main content

Module cache

Module cache 

Source
Expand description

HTTP caching infrastructure for Sentinel

This module provides the foundation for HTTP response caching using Pingora’s cache infrastructure.

Current features:

  • Cache configuration per route
  • Cache statistics tracking
  • Cache key generation
  • TTL calculation from Cache-Control headers
  • In-memory cache storage backend (for development/testing)

§Storage Backends

The default storage is an in-memory cache suitable for development and single-instance deployments. For production with large cache sizes or persistence needs, consider implementing a disk-based storage backend.

Structs§

CacheConfig
Cache configuration for a route
CacheManager
Cache manager for HTTP responses
HttpCacheStats
HTTP cache statistics

Functions§

configure_cache
Configure the global cache storage settings.
get_cache_eviction
Get a static reference to the cache eviction manager
get_cache_lock
Get a static reference to the cache lock
get_cache_storage
Get a static reference to the HTTP cache storage
is_cache_enabled
Check if caching is globally enabled