Supplement · Nginx
Proxy cache và stale strategy
Cache key là contract correctness. Key thiếu scheme, host, query hoặc identity dimension có thể trả nhầm tenant/user; key quá rộng làm hit ratio thấp.
Lifecycle
proxy_cache_pathđịnh nghĩa zone metadata và disk layout; eviction phụ thuộc inactive/max_size.proxy_cache_valid, upstream headers và bypass/no_cache quyết định lưu/phục vụ.proxy_cache_lockgiảm thundering herd khi miss.use_staletăng availability nhưng phải có freshness/error budget rõ.- Purge/invalidation khó; versioned URL hoặc short TTL thường an toàn hơn wildcard invalidation.
Evidence: log
$upstream_cache_status, Age, key dimensions và origin request count trong lab.