Gzipping all HTTP traffic with Pyramid
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am creating a mobile service based on Pyramid framework. Because it's mobile everything to reduce bandwidth usage is plus. I am considering gzipping all the traffic, even dynamic HTML pages. What kind of hooks Pyramid framework provides for this? Or is there WSGI middleware for the task? I'd like to do this still on Python level, not Nginx/Apache, so I can better statistics how much gzip brings benefirts. 回答1: First of all I should stress that you should do this on the web server level (nginx or apache). There are several reasons for this: