function serveFile(path, type, string) {
    var typemap = {
        js:  "application/javascript",
        css: "text/css"
    };
    return function (req, res, next) {
        if (req.url !== path) {
            return next();
        }

        res.writeHead(200, {
            "Content-Type": typemap[type],
            "Content-Encoding": "gzip",
            "Cache-Control": "no-cache, no-store, must-revalidate",
            "Expires": 0,
            "Pragma": "no-cache"
        });

        if (gzipCache[path]) {
            return res.end(gzipCache[path]);
        }
        var buf = Buffer.from(string, "utf-8");
        zlib.gzip(buf, function (_, result) {
            gzipCache[path] = result;
            res.end(result);
        });
    };
}
Serve Gzipped files & cache them
@param app
@param all