如何从客户端请求时发送压缩的gzip压缩文件?
例如我有:
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请求?
答案 0 :(得分:0)
解析了压缩jade.renderFile()回调
返回的html数据