From 1fe9d2a21eb860a3c78701084e85327b4a91c75e Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Mon, 6 Feb 2012 23:04:02 -0800 Subject: [PATCH] Allow maxAge of server to be specified in a setting. --- node/server.js | 3 +-- node/utils/Settings.js | 5 +++++ settings.json.template | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/node/server.js b/node/server.js index e25127f49..9bd975471 100644 --- a/node/server.js +++ b/node/server.js @@ -61,8 +61,7 @@ console.log("Report bugs at https://github.com/Pita/etherpad-lite/issues") var serverName = "Etherpad-Lite " + version + " (http://j.mp/ep-lite)"; -//cache 6 hours -exports.maxAge = 1000*60*60*6; +exports.maxAge = settings.maxAge; //set loglevel log4js.setGlobalLogLevel(settings.loglevel); diff --git a/node/utils/Settings.js b/node/utils/Settings.js index e95702112..dcab13cc0 100644 --- a/node/utils/Settings.js +++ b/node/utils/Settings.js @@ -55,6 +55,11 @@ exports.requireSession = false; */ exports.editOnly = false; +/** + * Max age that responses will have (affects caching layer). + */ +exports.maxAge = 1000*60*60*6; // 6 hours + /** * A flag that shows if minification is enabled or not */ diff --git a/settings.json.template b/settings.json.template index 7cd0e8195..57bc5711b 100644 --- a/settings.json.template +++ b/settings.json.template @@ -38,6 +38,10 @@ /* if true, all css & js will be minified before sending to the client. This will improve the loading performance massivly, but makes it impossible to debug the javascript/css */ "minify" : true, + + /* How long may clients use served javascript code? Without versioning this + is may cause problems during deployment. */ + "maxAge" : 1000*60*60*6, // 6 hours /* This is the path to the Abiword executable. Setting it to null, disables abiword. Abiword is needed to enable the import/export of pads*/