The Node server will now honor an explicit "--cache" regardless whether "--debug" has been set

This commit is contained in:
Jeff Parsons 2017-09-25 15:35:25 -07:00 committed by Jeff Parsons
commit 97d5b294ef
2 changed files with 13 additions and 9 deletions

View file

@ -62,8 +62,12 @@ var pkg = require("../../../package.json");
/*
* fCache controls "index.html" caching; it is true by default and can be overridden using the setOptions()
* 'cache' property.
*
* NOTE: Even though we don't explicitly set fCache to true, that's the default, because we disable caching
* only when fCache is explicitly false; this is so we can detect when it has been explicitly set to true,
* ensuring that we cache files even when other settings (like fServerDebug) might suggest we shouldn't cache.
*/
var fCache = true;
var fCache;
/*
* fConsole controls console messages; it is false by default and can be overridden using the setOptions()
@ -326,7 +330,7 @@ function HTMLOut(sPath, sFile, fRebuild, req, done)
* Check the global cache setting, as well as the presence of ANY special commands
* that we would never want to cache.
*/
if (!fCache || fServerDebug || net.hasParm(net.GORT_COMMAND, null, req) || net.hasParm(net.REVEAL_COMMAND, null, req)) {
if (fCache === false || fServerDebug && !fCache || net.hasParm(net.GORT_COMMAND, null, req) || net.hasParm(net.REVEAL_COMMAND, null, req)) {
this.loadFile(this.sTemplateFile, true);
return;
}

View file

@ -51,13 +51,13 @@ var defines = require("./modules/shared/lib/defines");
var proclib = require("./modules/shared/lib/proclib");
var args = proclib.getArgs();
var fCache = (args.argv['cache'] === undefined? true : args.argv['cache']);
var fConsole = (args.argv['console'] === undefined? false : args.argv['console']);
var fDebug = (args.argv['debug'] === undefined? false : args.argv['debug']);
var fLogging = (args.argv['logging'] === undefined? false : args.argv['logging']);
var fPrivate = (args.argv['private'] === undefined? false : args.argv['private']);
var fRebuild = (args.argv['rebuild'] === undefined? false : args.argv['rebuild']);
var fSockets = (args.argv['sockets'] === undefined? false : args.argv['sockets']);
var fCache = args.argv['cache'];
var fConsole = args.argv['console'];
var fDebug = args.argv['debug'];
var fLogging = args.argv['logging'];
var fPrivate = args.argv['private'];
var fRebuild = args.argv['rebuild'];
var fSockets = args.argv['sockets'];
var HTMLOut = require("./modules/htmlout");