Self-hosting the Draco decoder can cut first-paint delay in Three.js configurators
A developer reports that the common setup of loading Draco's decoder from Google's CDN adds a cross-origin fetch before any geometry renders. In their measurements on real configurators, this added roughly 600ms to first paint on a cold cache. The suggested fix is to copy the decoder files from the installed Three.js package into the project's public folder and point the loader at that same-origin path. The decoder consists of WASM and a JavaScript wrapper, so the whole folder must be copied to avoid load failures. Because the decoder rarely changes, the author also recommends long cache lifetimes so returning visitors avoid refetching it.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in