Add caching to minify

This commit is contained in:
calzoneman 2014-02-24 18:32:54 -06:00
parent 5d9a8a1a3f
commit 5565dd49fd
2 changed files with 9 additions and 1 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ node_modules
*.cert
*.key
torlist
www/cache

View File

@ -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