简体   繁体   English

ASP.NET MVC WEB API Gzip压缩-解压缩

[英]ASP.NET MVC WEB API Gzip Compression - Decompression

Mainly i want to gzip compress all inbound and outbound traffic between my Android clients and Server in order to reduce bandwidth usage and increase performance. 主要是我想gzip压缩我的Android客户端和服务器之间的所有入站和出站流量,以减少带宽使用并提高性能。

What i want. 我想要的是。

  1. Compression of all normal MVC Controller responses 压缩所有正常的MVC控制器响应
  2. Compressing all WEB API Json outbound responses (Accept-Encoding: "gzip") 压缩所有WEB API Json出站响应(接受编码:“ gzip”)
  3. Being able to accept and decompress gzip incoming WEB API Post/Put Requests. 能够接受和解压缩gzip传入的WEB API发布/放置请求。 ( Content-Encoding: gzip header) 内容编码:gzip标头)
  4. Compression of all static files (Html, Css , Js) 压缩所有静态文件(HTML,Css,Js)
  5. All of the above working without having to configure any IIS setting in order to work on any hosting environment (Azure , AWS , Heroku etc). 以上所有方法都可以运行, 无需配置任何IIS设置即可在任何托管环境(Azure,AWS,Heroku等)上运行。
  6. Being able to toggle compression on specific controllers for inbound requests as well as outbound responses separately . 能够针对入站请求和出站响应分别在特定控制器上切换压缩。

I have searched and read all (well as many as i could) related answers but couldn't find a complete solution for all of the above functionality . 我已经搜索并阅读了所有(尽可能多)相关的答案,但找不到上述所有功能的完整解决方案。

也许本文可能是您问题的答案: ASP.NET Web API GZip压缩ActionFilter

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM