Modules§
Structs§
- Cached
Response - A cached HTTP response
- Proxy
Cache - Thread-safe LRU cache for HTTP responses
Constants§
- CACHE_
SIZE - Maximum number of cache entries
- CACHE_
TTL - Default cache TTL in seconds (1 hour)
- MAX_
CACHE_ BYTES - Maximum total size of all cached entries (50MB)
- MAX_
CONNECTIONS - Maximum number of concurrent connections
- MAX_
ENTRY_ SIZE - Maximum size of a single cache entry (5MB)
- MAX_
REQUEST_ SIZE - Maximum size of request headers (64KB)
- MAX_
RESPONSE_ SIZE - Maximum size of a single response that can be cached (10MB)
Functions§
- calculate_
ttl - Calculate TTL from Cache-Control headers, defaults to
CACHE_TTL - create_
cache_ key - Create a cache key from request parameters without allocation
- extract_
host - Extract host and port from HTTP headers
- is_
cacheable - Determine if a response should be cached based on method, path, and headers
- parse_
request - Parse an HTTP request, returns (method, path, headers) or None if invalid