Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/322.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在使用带有樱桃糖的瓶子时做出gzip反应?_Python_Compression_Gzip_Cherrypy_Bottle - Fatal编程技术网

Python 如何在使用带有樱桃糖的瓶子时做出gzip反应?

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

我希望在应用程序级别执行上述操作,而不是针对单个请求。在配置文件中使用另一种一次性解决方案/设置,使其成为服务器的默认设置,将非常有用

在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:

对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: