diff --git a/.gitignore b/.gitignore index 5d088858..96ead4f0 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ node_modules *.cert *.key torlist +www/cache diff --git a/lib/web/webserver.js b/lib/web/webserver.js index ad34a8d0..a96c0054 100644 --- a/lib/web/webserver.js +++ b/lib/web/webserver.js @@ -1,4 +1,5 @@ var path = require("path"); +var fs = require("fs"); var net = require("net"); var express = require("express"); var webroot = path.join(__dirname, "..", "www"); @@ -274,7 +275,13 @@ module.exports = { app.use(express.cookieParser()); if (Config.get("http.minify")) { - app.use(require("express-minify")()); + var cache = path.join(__dirname, "..", "..", "www", "cache") + if (!fs.existsSync(cache)) { + fs.mkdirSync(cache); + } + app.use(require("express-minify")({ + cache: cache + })); Logger.syslog.log("Enabled express-minify for CSS and JS"); } /* Order here is important