zlib和gzip的壓縮比較

背景:壓縮網頁html文檔並存儲,壓縮後可以減小數據庫的負擔html 思路:使用python自帶的zlib或gzip進行字符串內容的壓縮python 使用:壓縮等級越高,所用時間越長web 1. zlib(默認壓縮等級爲6) @time_count def zlib_compress(): res = zlib.compress(html.encode()) print('zlib
相關文章
相關標籤/搜索