XAMPP .htaccess AddEncoding Br Brotli [英] XAMPP .htaccess AddEncoding br brotli

查看:132
本文介绍了XAMPP .htaccess AddEncoding Br Brotli的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有安装全新的MacOs HighSierra

然后转到

I install no my MacOs HighSierra fresh XAMPP (osx-7.4.6-0-vm) and start it - server runs on IP 192.168.64.2 . Then I mount /opt/lampp and click to Explore. The Finder window open and I go to directory htdocs/. Then inside htdocs I create folder assets and inside it I copy file alice.wasm (this file is compressed using brotli (br)). You can download this test (brotli compressed) file using this jsfiddle generator. Inside htdocs I create following .htaccess file

<IfModule mod_mime.c>
  AddType application/wasm .wasm
  AddEncoding br .wasm
  AddOutputFilterByType DEFLATE application/wasm
</IfModule>

Problem

When I go to http://192.168.64.2/assets/alice.wasm browser not download file and in chrome>networks tab I see (here are more details)

(failed) net::ERR_CONTENT_DECODING_FAILED

However, when I change AddEncoding br .wasm to AddEncoding rar .wasm (or instead 'br' I use zip, or none) then browser download file (details) but the problem is that browser automatically NOT decompress file (so it save compressed file).

When I put this .htacces file and alice.wasm file to some AZURE apache-like server (but I don't have access to it configuration files) then browser download file and decompress it on the fly (details) - so this is POSSIBLE.

Question: What I should do to make XAMPP working as expected?

解决方案

It is very strange, but when I enable port forwarding

And go to http://localhost:8080/assets/alice.wasm then Chrome download file and automatically decompress it (exactly what I want). AZURE works on HTTPS and file was downloaded properly probably because brotli compression is support only for HTTPS - however probably on Chrome localhost is 'special' and allows it too.

这篇关于XAMPP .htaccess AddEncoding Br Brotli的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆