Caching
Memory, disk, stale responses and precise invalidation.
Two cache layers
UWAS combines an in-memory L1 response cache with an L2 disk cache. Enable caching globally, then choose per-domain behavior. Static file byte caching is a separate global setting.
global:
cache:
enabled: true
memory_limit: 512MB
disk_path: /var/cache/uwas
disk_limit: 10GB
default_ttl: 3600
grace_ttl: 86400
stale_while_revalidate: true
Control cacheability per domain
Set a time-to-live appropriate to your content. A positive s-maxage or max-age from the origin caps the configured TTL. Dynamic and authenticated routes need deliberate bypass rules; review the full upstream configuration before enabling a cache for an application.
domains:
- host: example.com
type: static
root: /var/www/html
cache:
enabled: true
ttl: 1800
Freshness and invalidation
Grace mode and stale-while-revalidate can serve an existing response during refresh. Client Cache-Control: no-cache and Pragma: no-cache headers no longer bypass the response cache; purge entries or configure a cache rule with bypass: true for fresh content. Purging a domain also clears its alias and www entries. Tag-based purge invalidates related content, and ESI assembles fragments.
uwas cache stats
uwas cache purge
Response headers on proxy domains
A cache rule’s cache_control value is sent to clients on proxied domains, on both cache misses and hits. Review these rules when upgrading because clients may start receiving headers previously overwritten by the origin.