Skip to content
Cache chunk diagram: half-second sections move through the preview caching pipeline.

Our test film cached in half the time on staging

I rebuilt the preview cache: half-second chunks, filled nearest the playhead first and kept on disk inside your browser.

Samrat Chowdhury, founder of MootionblueSamrat Chowdhury6 min read

Mootionblue renders everything in your browser. Our main test film has 473 layers across six compositions: 12.3 seconds, 740 frames at 60 fps. Played live, it stuttered.12

So I rebuilt how the preview is cached. Here’s what changed, what it bought us, and what still isn’t good enough.

Why a live preview stutters

In the candidate 8.5 staging runs, our 473-layer film played live at about 44 fps.1

A live preview draws every frame as it plays, reusing work where it can; at 60 fps each frame gets 16.7 ms. The live rate depends on preview quality, viewer zoom and the machine.15

Cached ACK rates were near 60 fps in these six test groups; live rates varied

In these six tested groups, cached ACK rates stayed near 60 fps while live rates varied.

Candidate 8.5 staging, Apple M1 Max, medians of three full-range 15 s plays per group. Cached fps counts main-thread receipts of worker acknowledgements; neither series is physical screen timing.

Max ACK gaps ranged from 26.6 to 30.0 ms; the strict 25 ms goal remained unmet. The matched short Half loop separately failed its gap bar. These full-trial fps values differ from the rolling cadence used by the headline stat.

Data and sources
Cached ACK rates were near 60 fps in these six test groups; live rates varied
GroupMeasureValueContext
Three projects · Half and AutoFilm · 473 layers · Half · Cached60.021 fpsCandidate 8.5 staging, medians of three 15 s plays.
Three projects · Half and AutoFilm · 473 layers · Half · Live43.537 fpsCandidate 8.5 staging, medians of three 15 s plays.
Three projects · Half and AutoFilm · Auto · Cached59.996 fpsCandidate 8.5 staging, medians of three 15 s plays.
Three projects · Half and AutoFilm · Auto · Live44.406 fpsCandidate 8.5 staging, medians of three 15 s plays.
Three projects · Half and AutoLight card · Half · Cached60.015 fpsCandidate 8.5 staging, medians of three 15 s plays.
Three projects · Half and AutoLight card · Half · Live60.002 fpsCandidate 8.5 staging, medians of three 15 s plays.
Three projects · Half and AutoLight card · Auto · Cached59.976 fpsCandidate 8.5 staging, medians of three 15 s plays.
Three projects · Half and AutoLight card · Auto · Live59.992 fpsCandidate 8.5 staging, medians of three 15 s plays.
Three projects · Half and AutoBracket · Half · Cached59.986 fpsCandidate 8.5 staging, medians of three 15 s plays.
Three projects · Half and AutoBracket · Half · Live50.184 fpsCandidate 8.5 staging, medians of three 15 s plays.
Three projects · Half and AutoBracket · Auto · Cached60.000 fpsCandidate 8.5 staging, medians of three 15 s plays.
Three projects · Half and AutoBracket · Auto · Live50.185 fpsCandidate 8.5 staging, medians of three 15 s plays.
Three projects · Half and Auto60 fps reference60 fpsReference line, not a measured sample.
Candidate 8.5 staging: cached versus live median fps.

Earlier staging builds already kept chunks on disk; this work improved how they fill and play back. The browser can still clear or evict that storage, so a cached preview is only ever a disposable copy.64

Cut the film into half-second chunks

The new cache works in small pieces:2

  1. I cut the project into half-second chunks, each keyed to exactly what it depends on.
  2. Automatic filling asks a background worker to draw missing chunks nearest the playhead first.
  3. It compresses finished frames and stores them on disk, inside your browser.
  4. A playback worker reads, decodes and draws ready frames on an offscreen canvas. We measure its frame acknowledgements separately from physical screen timing.

Illustration of eight half-second chunks at 60 fps, with six marked ready. Green highlights the selected chunk; dashed edges mark the two pending chunks. This is a diagram, not live cache status.

Interactive illustration of cached and pending chunks.

Each chunk’s key records what its frames visually depend on. An edit confined to shot two can leave unrelated chunks ready; a shared or project-wide change can make a wider range stale.

What keeps the cache, and what doesn’t

You do thisCache
Select a layer, zoom or pan the canvaskept
Save, rename the projectkept
Move the playhead or scrubkept
Change a layer’s position, colour or timingaffected chunks redraw
Switch preview qualitythat quality fills on its own
Visual changes make affected frames stale.

Nearest first, then outward

Automatic filling starts with the missing chunks nearest the playhead, and seeking changes that order. A manual work-range fill goes in timeline order. The automatic rule fits in a few lines:12

Illustrative only; chunks, cache, distance and playhead are supplied by the caller. The real automatic queue sorts by distance; separate pacing and quality policies respond to measured work and device hints.

fill-order.ts
// Fill the chunks nearest the playhead first.
const queue = chunks
  .filter((c) => !cache.has(c))
  .sort((a, b) => distance(a, playhead) - distance(b, playhead));
Illustrative queue ordering.

The test film is 25 chunks, filled outward from the playhead

Chunk number above; fill rank below. Rank 1 fills first. Scroll horizontally for the full diagram.

The 740-frame film has 24 full chunks of 30 frames and a final 20-frame chunk. Rank 1 starts with the chunk containing the 10.2 s playhead. All chunks are assumed missing.

Derived from 60 fps and the nearest-first rule: sort by distance from the playhead frame to each chunk; ties go to the earlier chunk. The film lasts 740/60 seconds (about 12.33 s).

A full chunk is 0.5 s; the last is about 0.33 s. This is not a recorded fill. This illustration assumes every chunk is missing.

Data and sources
The test film is 25 chunks, filled outward from the playhead
GroupMeasureValueContext
Chunk 1Frames 0–29Rank 2530 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 2Frames 30–59Rank 2430 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 3Frames 60–89Rank 2330 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 4Frames 90–119Rank 2230 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 5Frames 120–149Rank 2130 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 6Frames 150–179Rank 2030 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 7Frames 180–209Rank 1930 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 8Frames 210–239Rank 1830 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 9Frames 240–269Rank 1730 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 10Frames 270–299Rank 1630 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 11Frames 300–329Rank 1530 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 12Frames 330–359Rank 1430 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 13Frames 360–389Rank 1330 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 14Frames 390–419Rank 1230 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 15Frames 420–449Rank 1130 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 16Frames 450–479Rank 1030 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 17Frames 480–509Rank 830 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 18Frames 510–539Rank 630 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 19Frames 540–569Rank 430 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 20Frames 570–599Rank 230 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 21Frames 600–629Rank 130 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 22Frames 630–659Rank 330 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 23Frames 660–689Rank 530 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 24Frames 690–719Rank 730 frames; nearest-first derivation at 10.2 s, not recorded fill.
Chunk 25Frames 720–739Rank 920 frames; nearest-first derivation at 10.2 s, not recorded fill.
Illustrative nearest-first fill order; not a recorded fill.

With automatic caching on, filling starts by itself. In candidate 8.5 staging, the first green chunk appeared about 3.2 seconds after the first live frame: an existing project, an empty cache, and no input after opening.

Watch it fill

Illustration from the caching film; its timing is not a cache-fill measurement. Scrub it, or go full screen.

Illustration of preview caching: chunks turn green to represent completed disk writes.
0:00
−0:06
Illustration from the caching film.

Same film, same Mac, before and after

Caching the whole film33.5 →16.0 s▼ 52 %
Cached playback34.7 →60.0 fps▲ 72 %
Longest capture-callback gap242 →41 ms▼ 83 %

Candidate 8.1 → 8.5 staging · Apple M1 Max · 473-layer film · Auto quality · fill and rolling ACK fps: medians of 3 · capture gaps: maxima across 31

These are observed differences, not a controlled speedup: the older build ran on a much busier host. Playback fps counts rolling worker acknowledgements.

The gap is the longest wait between capture-stream video callbacks, not a physical screen hold. As in the source report, displayed fps and favorable percentages are truncated.

Visual changes make affected frames stale. Selecting, zooming, saving or moving the playhead keeps the cache.

Samrat Chowdhury, founder of MootionblueSamrat ChowdhuryFounder, Mootionblue

What’s next

Heavy films still play slower before they’re cached, and editing on slower laptops needs work. I wrote up the editing side in Editing while it caches, and how we measure smoothness in 33 ms.1

Sources

The Mootionblue reports below are internal test records, not public downloads. They identify the historical build, setup and signal behind each result. The diagrams and code examples are illustrative.

  1. Mootionblue. Candidate 8.5 staging report (C85-STAGING-REPORT.md), 22 October 2026, canonical fixture and three-trial comparison.

    473 layers across six compositions; 740 frames; live playback; 3.2 s first green chunk; 33.5 → 16.0 s fill, 34.7 → 60.0 rolling ACK fps and 242 → 41 ms maximum capture-callback gap. The older host was busier; this is not a controlled speedup.

  2. Mootionblue. Candidate 8.7.1 implementation review, 24 October 2026, commit 2009c8ef.

    Half-second chunks, visual dependencies, invalidation, nearest-first automatic fill, timeline-order manual fill, worker rendering, disk storage and worker playback. This is a code review, not a timing trial.

  3. Mootionblue. Round 14 local performance report (R14-REPORT.md), 22 October 2026, Smart Auto and memory policy, build 3033195b.

    The Auto choice of 960 × 540 is a local result on an M1 Max, separate from candidate 8.5 staging.

  4. MDN. Origin private file system.

    Browser-managed disk storage, quotas and deletion when site data is cleared. Accessed 25 October 2026.

  5. WHATWG. HTML Living Standard, event loop processing model.

    Animation callbacks and rendering opportunities; 1000 / 60 gives about 16.7 ms. Accessed 25 October 2026.

  6. Mootionblue. Round 11 local report (R11-REPORT.md, undated) and round 12 local report (R12-REPORT.md), 22 October 2026.

    The earlier cache already used disk-backed chunks and a decode worker. The post describes improvements to filling and playback, not the invention of disk storage.

Samrat Chowdhury, founder of MootionblueSamrat Chowdhury

Mootionblue is in private beta. Join the waitlist and we’ll send you an invite as soon as there’s room.

No spam. One email when your invite is ready.