Files
Miguel Angel Simon Sierra 52f3ed8493 perf(studio): one media resolution layer for the Studio document
VideoThumbnail and VideoFrameThumbnail each created a hidden <video> per
component instance with no shared cache, so N clips on one source meant N
extractions. Their sibling AudioWaveform had exactly the peaksCache /
decodeInFlight pair both lacked, and mediaProbe's `failed` Set never
expired — a transient probe failure was permanent for the tab's life.

Generalise AudioWaveform's pair into mediaResolver: in-flight dedup keyed
by normalized URL, a bounded LRU, an expiring failure record, a
concurrency cap, and one client-side frame extractor. All four consumers
move onto it; mediaProbe and AudioWaveform retire their private caches.

The cache key is (src, duration), not src: VideoThumbnail derives its six
timestamps from the clip's duration, so two clips trimmed differently from
one source legitimately need different frames.

Scope: this dedups traffic issued by the Studio document only. The media
requests issued by <audio src>/<video src> inside the preview iframe are
not reachable from a Studio-document module and are unaffected.

Bounds come from the existing TIMELINE_VIEWPORT_BUDGETS fields
(thumbnailCacheEntries, waveformCacheEntries, metadataRegistryEntries,
concurrentVideoDecodes, concurrentMetadataJobs, metadataFailureTtlMs),
which until now had no enforcing consumer.
2026-08-03 21:59:03 -07:00
..
2026-08-02 21:57:19 -07:00
2026-08-02 21:57:19 -07:00
2026-08-02 21:57:19 -07:00