簡體   English   中英

將Bottle與Cherrypy一起使用時如何gzip響應?

[英]How to gzip response while using Bottle with Cherrypy?

我想在應用程序級別而不是針對單個請求進行上述操作。配置文件中的另一種一次性解決方案/設置將其設置為服務器的默認設置將很有幫助。

使用tools.gzip.on: Truetools.gzip.on: True配置文件上為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:

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM