Skip to main content

application/wasm

application

The MIME type for WebAssembly binary modules. Browsers require WebAssembly files to be served as application/wasm for streaming compilation (WebAssembly.instantiateStreaming). Serving with the wrong type (application/octet-stream) forces buffer-based compilation which is slower and prevents streaming.

Details

application/wasm is defined by the W3C WebAssembly Core Specification and IANA-registered.

Streaming compilation: WebAssembly.instantiateStreaming() starts compiling as bytes arrive. It requires the server to return application/wasm. If the wrong type is returned, browsers throw a TypeError and fall back to the slower WebAssembly.instantiate() with a buffer.

Server config: ensure your web server maps .wasm → application/wasm. nginx and Apache may not have this mapping by default.

nginx config: types { application/wasm wasm; }

Content-Encoding: WebAssembly binaries should be served with gzip or brotli Content-Encoding (they compress well). Do NOT ship .wasm.gz – use content negotiation and Content-Encoding instead.

Common use

WebAssembly module delivery for browser applications

See Also