Fetch a baked cluster mesh, transparently preferring a gzip-compressed sibling.
Tries ${url}.gz first. How that arrives depends on the host:
Most servers (Vite, and CDNs) serve a .gz file with Content-Encoding: gzip,
so the browser streams + inflates it natively — arrayBuffer() is already
the plain payload (peak ≈ decompressed size, which we parse anyway). This is the
memory-friendly path.
A bare static host may serve the .gz as opaque bytes with no Content-Encoding;
then we inflate it ourselves via DecompressionStream.
We can't rely on the Content-Encoding header (the fetch spec strips it after a
transparent decode), so we sniff the magic bytes: gzip starts 1f 8b, our
payload starts with MAGIC ("TDAG"). Falls back to the raw url. Returns
null if neither exists.
Fetch a baked cluster mesh, transparently preferring a gzip-compressed sibling.
Tries
${url}.gzfirst. How that arrives depends on the host:.gzfile withContent-Encoding: gzip, so the browser streams + inflates it natively —arrayBuffer()is already the plain payload (peak ≈ decompressed size, which we parse anyway). This is the memory-friendly path..gzas opaque bytes with no Content-Encoding; then we inflate it ourselves viaDecompressionStream.We can't rely on the
Content-Encodingheader (the fetch spec strips it after a transparent decode), so we sniff the magic bytes: gzip starts1f 8b, our payload starts with MAGIC ("TDAG"). Falls back to the rawurl. Returnsnullif neither exists.