You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
Emby calls /Videos/{id}/stream three times for each HTTPStrm playback.
MediaWarp recalculates the redirect on every request (HEAD chain, signed URL refresh, etc.).
Upstream providers (PikPak, Aliyun, …) may return different URLs or single-use tokens per resolution.
Results: noticeable latency (up to ~40% on public links) and risk of inconsistent redirects when providers invalidate tokenized URLs mid-flow.
Solution
Added an HTTPStrm-specific in-memory cache keyed by MediaSourceId.
Reuse the first resolved URL for the subsequent two Emby requests until the entry expires.
New configuration options:
HTTPStrm.CacheEnable (bool) — enable/disable the cache.
HTTPStrm.CacheTTL (duration, default 1m) — control entry lifetime.
Integrated the cache into both Emby and Jellyfin handlers right before final redirect logic.
Validated settings during config load (time.ParseDuration, fallback to 1m); works alongside FinalURL.
Thread-safe map with automatic eviction of expired entries.
Impact
When resolving private/intranet URLs to public ones, the average access time drops by ≈30% because the second and third requests hit the cache.
Providers issuing single-use tokens no longer see three back-to-back resolutions, reducing divergent redirects or premature expirations.
Users can switch the cache off to keep the original behavior if needed.
0 commit comments