diff --git a/bower.json b/bower.json index e2763ccfd..809fd5323 100644 --- a/bower.json +++ b/bower.json @@ -31,7 +31,7 @@ "hyperjson": "~1.4.0", "chainpad-crypto": "^0.1.8", "chainpad-listmap": "^0.5.0", - "chainpad": "^5.0.0", + "chainpad": "^5.1.0", "chainpad-netflux": "^0.7.0", "file-saver": "1.3.1", "alertifyjs": "1.0.11", diff --git a/docs/example.nginx.conf b/docs/example.nginx.conf index d56920bf5..44b12ade8 100644 --- a/docs/example.nginx.conf +++ b/docs/example.nginx.conf @@ -75,6 +75,12 @@ server { } location ^~ /blob/ { + add_header Cache-Control max-age=31536000; + try_files $uri =404; + } + + location ^~ /datastore/ { + add_header Cache-Control max-age=0; try_files $uri =404; } diff --git a/server.js b/server.js index a7830cbaf..aac8d7513 100644 --- a/server.js +++ b/server.js @@ -123,6 +123,9 @@ app.get(mainPagePattern, Express.static(__dirname + '/customize.dist')); app.use("/blob", Express.static(Path.join(__dirname, (config.blobPath || './blob')), { maxAge: DEV_MODE? "0d": "365d" })); +app.use("/datastore", Express.static(Path.join(__dirname, (config.filePath || './datastore')), { + maxAge: "0d" +})); app.use("/customize", Express.static(__dirname + '/customize')); app.use("/customize", Express.static(__dirname + '/customize.dist')); @@ -188,6 +191,7 @@ var custom_four04_path = Path.resolve(__dirname + '/customize/404.html'); var send404 = function (res, path) { if (!path && path !== four04_path) { path = four04_path; } Fs.exists(path, function (exists) { + res.setHeader('Content-Type', 'text/html; charset=utf-8'); if (exists) { return Fs.createReadStream(path).pipe(res); } send404(res); }); @@ -250,4 +254,4 @@ var nt = nThen(function (w) { if (config.debugReplName) { require('replify')({ name: config.debugReplName, app: debuggableStore }); -} \ No newline at end of file +}