added brotli compression for godot binaries

develop
Hecht 5 months ago
parent 57e53526e6
commit ce9cd7513e

@ -57,6 +57,29 @@ DirectoryIndex index.php
# Rewrite all other queries to the front controller.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ %{ENV:BASE}/index.php [L]
# Brotli
# If the web browser accept brotli encoding ...
RewriteCond %{HTTP:Accept-encoding} br
# ... and the web browser is fetching a probably pre-compressed file ...
RewriteCond %{REQUEST_URI} .*\.(pck|wasm)$
# ... and a matching pre-compressed file exists ...
RewriteCond %{REQUEST_FILENAME}\.br -s
# ... then rewrite the request to deliver the brotli file
RewriteRule ^(.*) $1.br
# For each file format set the correct mime type (otherwise brotli mime type is returned) and prevent Apache for recompressing the files
RewriteRule "\.pck\.br$" "-" [T=application/octet-stream,E=no-brotli,E=no-gzip]
RewriteRule "\.wasm\.br$" "-" [T=application/wasm,E=no-brotli,E=no-gzip]
<FilesMatch "\.(pck|wasm)\.br$">
# Prevent mime module to set brazilian language header (because the file ends with .br)
RemoveLanguage .br
# Set the correct encoding type
Header set Content-Encoding br
# Force proxies to cache brotli & non-brotli files separately
Header append Vary Accept-Encoding
</FilesMatch>
</IfModule>
<IfModule !mod_rewrite.c>

Loading…
Cancel
Save