Python 如何在使用带有樱桃糖的瓶子时做出gzip反应?
我希望在应用程序级别执行上述操作,而不是针对单个请求。在配置文件中使用另一种一次性解决方案/设置,使其成为服务器的默认设置,将非常有用 在cherrypy配置文件上使用Python 如何在使用带有樱桃糖的瓶子时做出gzip反应?,python,compression,gzip,cherrypy,bottle,Python,Compression,Gzip,Cherrypy,Bottle,我希望在应用程序级别执行上述操作,而不是针对单个请求。在配置文件中使用另一种一次性解决方案/设置,使其成为服务器的默认设置,将非常有用 在cherrypy配置文件上使用tools.gzip.on:True。 看到这个了吗 如果您可以使用uwsgi,也可以将其添加到配置中: route-if = contains:${HTTP_ACCEPT_ENCODING};gzip goto:mygzipper route-run = last: route-label = mygzipper ; pass
tools.gzip.on:True
。
看到这个了吗
如果您可以使用uwsgi,也可以将其添加到配置中:
route-if = contains:${HTTP_ACCEPT_ENCODING};gzip goto:mygzipper
route-run = last:
route-label = mygzipper
; pass the response to the gzip transformation
route = .* delheader:Content-Length
route = .* gzip:
对cherrypy配置文件使用
tools.gzip.on:True
。
看到这个了吗
如果您可以使用uwsgi,也可以将其添加到配置中:
route-if = contains:${HTTP_ACCEPT_ENCODING};gzip goto:mygzipper
route-run = last:
route-label = mygzipper
; pass the response to the gzip transformation
route = .* delheader:Content-Length
route = .* gzip: