Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to serve static WebAssembly and TensorFlow Lite files #7585

Conversation

danxuliu
Copy link
Member

NGINX equivalent to nextcloud/server#29747

Since Talk 13 (and thus Nextcloud 23) WebAssembly (.wasm) and TensorFlow Lite (.tflite) files need to be loaded from the web server to provide certain features (like the background blur in the WebUI).

Those files can be treated in a similar way to other static resources, and there should not be any problem caching or compressing them. However, as compressed TensorFlow Lite files are only ~12% smaller, the compression directive depends on the MIME type and there is no standard MIME type for TensorFlow Lite files, for now only WebAssembly files are compressed.

Depending on the setup application/wasm may not be associated with .wasm files, so the directive was added just in case, as the compression is enabled through the MIME type and, besides that, the browsers log a warning if the expected MIME type is not returned.

In any case my NGINX knowledge is almost null, so please review carefully :-)

Since Talk 13 (and thus Nextcloud 23) WebAssembly (.wasm) and TensorFlow
Lite (.tflite) files need to be loaded from the web server to provide
certain features (like the background blur in the WebUI).

Those files can be treated in a similar way to other static resources,
and there should not be any problem caching or compressing them.
However, as compressed TensorFlow Lite files are only ~12% smaller,
the compression directive depends on the MIME type and there is no
standard MIME type for TensorFlow Lite files, for now only WebAssembly
files are compressed.

Depending on the setup "application/wasm" may not be associated with
".wasm" files, so the directive was added just in case, as the
compression is enabled through the MIME type and, besides that, the
browsers log a warning if the expected MIME type is not returned.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
@danxuliu
Copy link
Member Author

/backport to stable23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants