[英]nodejs http request compression (without express but with the possibility of renderize files with jade)
客戶端請求時如何發送壓縮的壓縮文件?
例如,我有:
var zlib = require("zlib"),
http = require("http");
http.createServer(function(req, res) {
/*req.url is the url of the file requested
how to compress and send the file here?
consider that usually (facoltative) I can renderize the file also with Jade.renderFile()
so the best solution is to compress the output before sending to client */
}).listen(80);
以及如何緩存以避免多個gzip請求?
解決了壓縮jade.renderFile()回調返回的html數據
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.