diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2021-11-17 12:30:12 +0100 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2021-11-17 13:00:39 +0100 |
commit | 24bc96ad095ea2d5650be8827eee641a32ca3c54 (patch) | |
tree | 854fd5f3787bd160a3925cbaefcce442c65b7f55 /.htaccess | |
parent | 788a1fcca4b84e7bcf8f93826c968688077a81f9 (diff) | |
download | nextcloud-server-24bc96ad095ea2d5650be8827eee641a32ca3c54.tar.gz nextcloud-server-24bc96ad095ea2d5650be8827eee641a32ca3c54.zip |
Allow to serve static WebAssembly and TensorFlow Lite files
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 it is not worth to compress
them.
Moreover, no directives to compress WebAssembly files were added either,
as it seems that they would override any other compression directives
set in the default server configuration; for reference it could be done
with something like:
<IfModule mod_deflate.c>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE application/wasm
</IfModule>
</IfModule>
Depending on the setup "application/wasm" may not be associated with
".wasm" files, so the directive was added just in case, as otherwise
browsers log a warning.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to '.htaccess')
-rw-r--r-- | .htaccess | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/.htaccess b/.htaccess index 4986f7d380f..ce84f0698c7 100644 --- a/.htaccess +++ b/.htaccess @@ -43,7 +43,7 @@ </IfModule> # Add cache control for static resources - <FilesMatch "\.(css|js|svg|gif|png|jpg|ico)$"> + <FilesMatch "\.(css|js|svg|gif|png|jpg|ico|wasm|tflite)$"> Header set Cache-Control "max-age=15778463" </FilesMatch> @@ -75,6 +75,7 @@ <IfModule mod_mime.c> AddType image/svg+xml svg svgz + AddType application/wasm wasm AddEncoding gzip svgz </IfModule> |