From 0470a266fd4965aa3de1584dad8f7042c6694dc1 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sun, 18 Sep 2016 16:23:56 +0800 Subject: [PATCH] Update to prevent caching and crawling status --- app.js | 4 ++++ lib/response.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 683d313..1d3c7a9 100644 --- a/app.js +++ b/app.js @@ -198,6 +198,10 @@ app.get("/500", function (req, res) { //get status app.get("/status", function (req, res, next) { realtime.getStatus(function (data) { + res.set({ + 'Cache-Control': 'private', // only cache by client + 'X-Robots-Tag': 'noindex, nofollow' // prevent crawling + }); res.send(data); }); }); diff --git a/lib/response.js b/lib/response.js index df8abfd..796f951 100755 --- a/lib/response.js +++ b/lib/response.js @@ -274,7 +274,7 @@ function actionInfo(req, res, note) { 'Access-Control-Allow-Origin': '*', //allow CORS as API 'Access-Control-Allow-Headers': 'Range', 'Access-Control-Expose-Headers': 'Cache-Control, Content-Encoding, Content-Range', - 'Cache-Control': 'private', + 'Cache-Control': 'private', // only cache by client 'X-Robots-Tag': 'noindex, nofollow' // prevent crawling }); res.send(data);