Gzip for Phoenix的Plug.Conn.send_file

时间:2017-11-23 14:40:26

标签: elixir gzip phoenix-framework

有没有办法使用Plug.Conn中的send_file并让它进行gzip压缩?我启用:在配置中压缩,它适用于json响应,但不适用于send_file。

1 个答案:

答案 0 :(得分:0)

我可以说,不支持压缩send_file/5的响应正文。插件使用牛仔,其源代码在评论中说," We do not compress sendfile bodies。"

似乎有相关的a GitHub issue,如果您正在寻找选项,可以通过将未压缩文件与压缩版本进行交换来讨论可能的解决方法。