From 905c48db4f89b69b2cd508d8a7605d8ab4efcdd9 Mon Sep 17 00:00:00 2001 From: Liana <32243840+liana-p@users.noreply.github.com> Date: Mon, 9 Oct 2023 00:49:55 +0100 Subject: [PATCH] add list of cors headers needed in web export (#8020) Adds instructions for setting up the correct CORS headers to host games with the SharedArrayBuffer --- tutorials/export/exporting_for_web.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tutorials/export/exporting_for_web.rst b/tutorials/export/exporting_for_web.rst index 59c1e90e9..d0d894644 100644 --- a/tutorials/export/exporting_for_web.rst +++ b/tutorials/export/exporting_for_web.rst @@ -227,6 +227,15 @@ The ``.pck`` file is binary, usually delivered with the MIME-type other than :mimetype:`application/wasm` can prevent some start-up optimizations. +.. tip:: + Godot 4 web exports use the `SharedArrayBuffer `__, and require the following CORS headers to be set when serving the files: + + :: + Cross-Origin-Opener-Policy: same-origin + Cross-Origin-Embedder-Policy: require-corp + + + Delivering the files with server-side compression is recommended especially for the ``.pck`` and ``.wasm`` files, which are usually large in size. The WebAssembly module compresses particularly well, down to around a quarter