Menu

Self-host your Draco decoder - the 600ms CDN tax on Three.js configurators
📰

Self-host your Draco decoder - the 600ms CDN tax on Three.js configurators

DEV Community: javascript·Dominik·about 15 hours ago
#IiqZ3fRV
Reading 0:00
15s threshold

Draco compression is the difference between a 90MB glTF export and a 3MB one. For CAD-heavy product models it is not optional. But there is a trap in the standard setup that quietly costs you half a second on first paint.

The default that looks fine

Most examples point the decoder at Google's CDN:

const dracoLoader = new DRACOLoader () dracoLoader . setDecoderPath ( ' https://www.gstatic.com/draco/v1/decoders/ ' )

Enter fullscreen mode

Exit fullscreen mode

It works. It also means every first-time visitor makes a cross-origin trip to fetch the WASM decoder before a single triangle appears.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.