Skip to content

Commit 905c48d

Browse files
authored
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
1 parent a0789aa commit 905c48d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tutorials/export/exporting_for_web.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,15 @@ The ``.pck`` file is binary, usually delivered with the MIME-type
227227
other than :mimetype:`application/wasm` can prevent some start-up
228228
optimizations.
229229

230+
.. tip::
231+
Godot 4 web exports use the `SharedArrayBuffer <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer>`__, and require the following CORS headers to be set when serving the files:
232+
233+
::
234+
Cross-Origin-Opener-Policy: same-origin
235+
Cross-Origin-Embedder-Policy: require-corp
236+
237+
238+
230239
Delivering the files with server-side compression is recommended especially for
231240
the ``.pck`` and ``.wasm`` files, which are usually large in size.
232241
The WebAssembly module compresses particularly well, down to around a quarter

0 commit comments

Comments
 (0)