Skip to content

MoqxCache: cap publisher cache duration, skip caching when mcd=0#302

Open
afrind wants to merge 1 commit intomainfrom
feat/max-allowed-duration
Open

MoqxCache: cap publisher cache duration, skip caching when mcd=0#302
afrind wants to merge 1 commit intomainfrom
feat/max-allowed-duration

Conversation

@afrind
Copy link
Copy Markdown
Contributor

@afrind afrind commented May 8, 2026

Adds setMaxAllowedCacheDuration() so operators can cap publisher-set cache durations. setTrackExtensions() now extracts the publisher's max cache duration extension, clamps it to the cap, and falls back to defaultMaxCacheDuration_ when the publisher doesn't set one. setMaxCacheDuration/clearMaxCacheDuration are now private; callers should go through setTrackExtensions.

Adds CacheTrack::shouldSkipCaching() which returns true when evicted or when maxCacheDuration is explicitly 0ms. defaultMaxCacheDuration=0ms acts as "opt-in only" mode: publisher must set a non-zero duration or objects are forwarded without being written to cache.

Wires cache.maxCacheDuration from CacheConfig into the new setMaxAllowedCacheDuration() call in MoqxRelay, removing the TODO.


This change is Reviewable

Adds setMaxAllowedCacheDuration() so operators can cap publisher-set
cache durations. setTrackExtensions() now extracts the publisher's
max cache duration extension, clamps it to the cap, and falls back to
defaultMaxCacheDuration_ when the publisher doesn't set one.
setMaxCacheDuration/clearMaxCacheDuration are now private; callers
should go through setTrackExtensions.

Adds CacheTrack::shouldSkipCaching() which returns true when evicted
or when maxCacheDuration is explicitly 0ms. defaultMaxCacheDuration=0ms
acts as "opt-in only" mode: publisher must set a non-zero duration or
objects are forwarded without being written to cache.

Wires cache.maxCacheDuration from CacheConfig into the new
setMaxAllowedCacheDuration() call in MoqxRelay, removing the TODO.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant