Add caching to minify
This commit is contained in:
parent
5d9a8a1a3f
commit
5565dd49fd
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -9,3 +9,4 @@ node_modules
|
|||
*.cert
|
||||
*.key
|
||||
torlist
|
||||
www/cache
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue