Skip to content

Track Metron's X-Cache header via Session.last_cache_status - #158

Merged
bpepple merged 1 commit into
mainfrom
wire-x-cache
Aug 20, 2026
Merged

Track Metron's X-Cache header via Session.last_cache_status#158
bpepple merged 1 commit into
mainfrom
wire-x-cache

Conversation

@bpepple

@bpepple bpepple commented Aug 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Metron now reports whether cached endpoints served a response from cache (HIT) or generated it fresh (MISS) via a new X-Cache response header (Metron-Project/metron#604).
  • Adds Session.last_cache_status, which mirrors the existing rate_limit_status pattern: updated from response headers after every request, thread-safe via its own lock.
  • Since X-Cache is per-endpoint (only Metron's cached views send it — user-scoped viewsets like pull list/collection/wish list never do), a response missing the header resets the status to None instead of preserving a stale HIT/MISS from an earlier, cached endpoint.

Metron now reports whether cached endpoints served a response from cache ("HIT") or generated it fresh ("MISS") via the X-Cache header. Since the header is per-endpoint (only cached views send it), a missing header resets the status to None rather than keeping a stale value from an earlier, cached endpoint.
@bpepple bpepple self-assigned this Aug 20, 2026
@bpepple bpepple added the enhancement New feature or request label Aug 20, 2026
@bpepple
bpepple merged commit e484c0c into main Aug 20, 2026
11 checks passed
@bpepple
bpepple deleted the wire-x-cache branch August 20, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant