set cace-control header for preview files

pull/117/merge
nightwing 2015-07-23 12:07:14 +00:00
rodzic eda61cfd08
commit 089be2fd68
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -147,7 +147,6 @@ define(function(require, exports, module) {
var isDir = path[path.length-1] == "/";
if (isDir || parsedUrl.pathname.match(/\.html?$/i)) {
req.headers["accept-encoding"] = "identity";
delete req.headers["if-none-match"];
delete req.headers["if-range"];
} else {
req.headers["accept-encoding"] = "gzip";
@ -327,6 +326,8 @@ define(function(require, exports, module) {
function serveFile(request) {
debug("forward file %s", request.url);
request.headers["x-robots-tag"] = "noindex, nofollow";
if (!request.headers["Cache-Control"])
request.headers["Cache-Control"] = "max-age=31536000,no-cache";
res.writeHead(request.statusCode, request.headers);
request.pipe(res);
}