I built a background remover that runs 100% in the browser. Here's how I made it 7x faster A developer built Remove de Fundo, a browser-based background remover that runs its AI model entirely client-side, and cut click-to-cutout time from 43.8 seconds to 6.4 seconds on the same laptop and photo. The speedups came from self-hosting model files with immutable caching, enabling cross-origin isolation for SharedArrayBuffer threads, capping ONNX Runtime thread counts to stop spin-waiting from starving PNG encoding, and warming up WebGPU shaders on user intent. Most "free" background removers upload your photo to a server, run a model on a GPU, and then ask you to pay for the full-resolution download. I wanted the opposite: the photo never leaves your device , the download is full resolution, and there is no account. So I built Remove de Fundo https://removedefundo.com/en/ , a background remover where the AI model runs entirely in the browser. The first version worked, but on real phones it was slow enough that people left before seeing a result. This post is about what made it slow and what fixed it. End result on the same laptop and the same photo: 43.8 s → 6.4 s from click to cutout. Everything happens client-side. The server only serves static files. The first visit downloads ~100 MB model + ONNX runtime . That is unavoidable for an in-browser model, but I noticed something worse: the CDN serving the model sent no Cache-Control header , and the edge marked it cf-cache-status: DYNAMIC . So returning visitors were often downloading the model again, and nothing was cached near the user. Fix: self-host the model files. A build script downloads the model chunks once and puts them in public/ai/