I ship a few "server-class" engines in plain static web pages: ffmpeg.wasm for video, Whisper for transcription, an ONNX segmentation model for background removal, and Tesseract for OCR. No backend at all. They all work, but each one taught me something. Here are the practical lessons.
1. Never load the engine with the page
A 30 MB WASM binary in the critical path will ruin your Largest Contentful Paint and your search rankings. The page should be fully usable (dropzone, options, explanation) before any engine code arrives.
The pattern I use:
// Import only when needed... async function getFFmpeg () { const { FFmpeg } = await import ( " @ffmpeg/ffmpeg " ); const ff = new FFmpeg (); await ff . load ({ coreURL , wasmURL }); return ff ; }
// ...but warm the cache once the page is idle window . addEventListener ( " load " , () => { const conn = ( navigator as any ). connection ; if ( conn ?.…