You upload a clip, the render finishes, and the footage looks great. Then a teammate opens a gallery of forty previews and watches the spinners arrive one at a time. The encode is fine. The model output is fine. What is failing is the layer nobody demos: caching.
Creative teams tend to optimize what they can see. They obsess over resolution, color, and motion, then quietly accept a browsing experience that stutters on every hover. The fix is rarely a faster encoder or a bigger machine. It is a deliberate caching and delivery strategy for two very different asset classes that share one pipeline but have almost nothing else in common: small preview images requested constantly, and large video segments requested sequentially.
This guide walks through a practical workflow. You will learn how thumbnail caching works, how to tune video quality without inflating bandwidth, how to design cache keys and lifetimes that do not spiral into chaos, and how to measure whether any of it actually helped. The advice is tool-agnostic, so it applies whether you render with a hosted model, a local diffusion setup, or a hybrid of both.
Before touching configuration, separate the catalog into two populations. They have different request patterns, different failure costs, and different correct answers.
A single project might produce dozens of previews for one finished clip: first frame, midpoint, three keyframe variants, and a handful of alternates for A/B selection. Each image is 20–200 KB. They are requested in bursts whenever someone scrolls a timeline, opens a project, or shares a link. Because they are cheap to store but expensive to regenerate, they are the single best caching target in the entire pipeline.
A 60-second clip at 1080p might be 40–90 MB depending on motion and codec. It is requested in order, usually once per viewer, and rarely twice. Caching it aggressively at the origin wastes storage; caching it poorly at the edge wastes bandwidth. The right answer is a short-lived edge cache plus range support, not a permanent copy.
Once you internalize that split, most contradictory advice about caching stops being contradictory. Thumbnails want long lifetimes and wide distribution. Video segments want short lifetimes and precise delivery.
A thumbnail cache is not one thing. Depending on where you look, it is at least four:
Most bugs live in the fourth item. Teams generate perfect thumbnails, store them correctly, and then ship them with Cache-Control: no-store because someone copy-pasted a header from an authenticated endpoint. The image is regenerated on every single view, and the pipeline looks slow for no apparent reason.
A missed video segment causes one visible stall. A missed thumbnail causes a cascade: forty images each trigger a backend fetch, a decode, and a resize. On a mobile connection with 200 ms of latency, that cascade can add three to five seconds to a page that should feel instant. In practice, a 5% miss rate on thumbnails hurts perceived speed more than a 20% miss rate on video segments.
Caching problems are usually keying problems. If two different versions of an asset hash to the same key, users see stale images. If the same asset hashes to many keys, your hit rate collapses.
A workable key includes the asset identity, a render version, dimensions, format, and a quality preset. Something like:
thumb:{assetId}:v{renderVersion}:{width}x{height}:{format}:{quality}
Three rules keep this healthy. First, never include timestamps or session IDs in a cache key; they guarantee zero reuse. Second, never include user-specific data unless the image genuinely differs per user. Third, bump renderVersion whenever the underlying footage changes, so old entries expire naturally through key rotation instead of manual purges.
Purging is a blunt instrument that scales poorly and often fails silently across multiple edge regions. Versioned keys are better: publish a new key, let the old one age out. Reserve explicit purge calls for legal or compliance removals, where waiting is not acceptable.
A simple TTL ladder works well in most video projects:
The logic behind the ladder is simple: immutable content gets long lifetimes, mutable content gets short ones.
Serving one 1280×720 JPEG to every context is the most common wasted-bandwidth mistake in AI video galleries. A contact sheet showing sixty frames at 120 px wide does not need a 400 KB image.
Render a small set of variants instead:
Use srcset and sizes so the browser picks correctly, and always set explicit width and height attributes to prevent layout shift. Two additional details matter more than people expect. First, strip metadata from thumbnails; EXIF blocks add tens of kilobytes for no benefit. Second, generate thumbnails from a decoded frame rather than re-encoding a previously generated thumbnail, or compression artifacts will compound across generations.
Quality optimization is not "raise the resolution." It is the art of spending bits where the eye notices and saving them where it does not. A 1080p file at 4.5 Mbps can look better than a 4K file at 12 Mbps if the bits land in the right places.
Start with three to five rungs, not twelve. A practical ladder for AI-generated footage:
| Height | Bitrate | Codec | Typical use |
|---|---|---|---|
| 360p | 600–900 kbps | H.264 or AV1 | Mobile data, quick review |
| 540p | 1.2–1.8 Mbps | H.264 or AV1 | Default mobile |
| 720p | 2.5–3.5 Mbps | H.264 or AV1 | Desktop default |
| 1080p | 4.5–6.5 Mbps | H.264 or AV1 | High quality viewing |
| 1440p+ | 9–16 Mbps | AV1 or HEVC | Large screens, grading review |
Per-title encoding beats a fixed ladder when your catalog varies a lot. A static talking-head clip needs far fewer bits than a particle-heavy transition. If per-title encoding is out of reach, at least group your ladder into two profiles: one for low-motion footage and one for high-motion footage.
Diffusion output behaves differently from camera footage in ways that matter to encoders:
A useful rule: preview at delivery settings before you finalize a look. Grading decisions made on a pristine master can look muddy once the 720p rung is doing the work.
A robust setup caches at three levels, each with a distinct job.
At the origin, cache the expensive operations: frame extraction, resizing, and format conversion. A generated thumbnail should be written once to object storage and served many times. If your API regenerates on every request, add a two-tier cache: a fast in-memory layer for hot assets and durable object storage for everything else. In-memory layers should be bounded by size, not by hope — LRU works well.
Also cache the metadata lookups. A thumbnail request that triggers three database queries before it finds the file has already lost the race. Index by asset ID and render version so lookups resolve in a single read.
Edge caching puts bytes close to viewers, but only if the cache is configured for the shape of the traffic. Video segments should be immutable and long-lived at the edge, with range requests enabled so players can seek. Manifests should be short-lived, so a re-encode is visible within a minute. Thumbnails sit between the two: long-lived, widely replicated, and small enough that tiered caching pays off.
Watch your cache tags. If every asset shares one tag, a purge invalidates the entire catalog. Tag by project or by asset group so purges stay surgical.
Half of perceived speed lives in the browser. Serve Cache-Control: public, max-age=2592000, immutable for versioned thumbnails, add an ETag for revalidation, and enable HTTP/2 or HTTP/3 so parallel image requests reuse a single connection. For video, avoid autoplay with sound in galleries — a muted, lazy-loaded, poster-first player cuts startup cost dramatically.
Use loading="lazy" on offscreen thumbnails, but eagerly load the first six to eight images in a grid. Lazy loading everything creates a visible pop-in effect on scroll that feels slower than loading early.
If you want a concrete sequence rather than principles, start here.
Cache-Control on thumbnails, manifests, and segments. Fix anything set to no-store or no-cache unintentionally.HIT, MISS, STALE) per request and track hit ratio, time to first byte, and rebuffer rate.Run the sequence once, measure, then iterate. Trying to do all eight at once without baselines makes it impossible to know which change delivered the gain.
Vanity dashboards show total bandwidth and storage. Useful dashboards show ratios and distributions:
Track these per region if you have a global audience. A pipeline that looks excellent in one continent can be mediocre in another purely because of edge placement.
Regenerating thumbnails on every request. Usually caused by a cache key containing a timestamp or by an authentication check that bypasses caching. Fix the key, then verify with repeated requests that the second one returns HIT.
Purging everything after every upload. Switch to versioned paths. Purges should be rare and targeted.
One giant JPEG per video. Add responsive variants. This is the fastest, cheapest win available.
Caching video segments forever at the origin. Storage costs grow without improving user experience. Short-lived edge caching with immutable segment names is the right pattern.
Ignoring mobile. A pipeline tuned on a wired desktop connection hides latency that dominates on cellular. Always test on a throttled profile.
Letting chunked uploads be retried with new keys. Interrupted uploads that restart with a fresh identifier create orphaned half-objects. Use deterministic upload keys so retries overwrite rather than duplicate.
Skipping the poster frame. Players that start with a black rectangle and no thumbnail feel broken even when they are fast. Always ship a poster image from the same variant set.
How long should thumbnails live in a cache?
Thirty days with versioned keys is a good default. Because the key changes when the asset changes, you never need to worry about serving stale images, and you avoid repeated regeneration.
Should I cache videos at the edge at all?
Yes, but with short lifetimes and immutable segment names. Cache segments for a week at the edge, and keep origin caching minimal unless a clip is genuinely viral.
Is AV1 worth the encoding cost?
For high-traffic catalogs, yes — the bandwidth savings over H.264 are substantial at the same perceived quality. For internal review tools with a handful of viewers, H.264 is fine and much faster to produce.
How do I stop thumbnails from looking blurry on retina screens?
Generate a variant at twice the CSS pixel width for your largest display size, and let srcset decide. Do not simply upscale a small variant.
What is the single highest-impact change?
Versioned cache keys with long TTLs on thumbnails. It is one change, it is low risk, and it fixes the most visible slowness in almost every AI video project.
Does denoising before encoding really help?
On diffusion-generated footage it usually does. Test on one representative clip: compare file size at a fixed quality setting with and without a light temporal denoise, and judge visually at delivery resolution.
Caching and quality tuning are not one-time tasks. Assets change, models change, and audience mix changes. The durable approach is a loop: measure hit ratios and delivery metrics, change one variable, re-measure after a full traffic cycle, and keep a short log of what moved the numbers.
Start with the boring parts — correct headers, versioned keys, three thumbnail sizes, a four-rung ladder — and resist the urge to rebuild the whole stack. Those basics typically deliver most of the perceived speed improvement, and they make every later optimization measurable. Once the foundation is solid, you can experiment with per-title encoding, smarter prefetching, and regional edge tuning with confidence, because you will finally be able to see what actually changed.

Alexander
Vidu Q4 alternatives compared: Kling 4.0, Seedance 2.5, Wan 3.0, and Runway Gen-4 — 4K support, input modes, durations, audio, and what each costs in credits on Domer.
The top 4K AI image generators on Domer compared: Flux 3 Klein, Nano Banana 2.1, GPT Image 2.5, GPT Image 2, and Nano Banana Pro — 4K credit costs, reference limits, and speed.
Nano Banana 2.1 vs GPT Image 2.5 Flare compared: credit costs per resolution, aspect ratios, reference images, text rendering, and which tasks fit each model.