From 7ee9f41b3a365d1fc83163196c66b47ab4d5eca0 Mon Sep 17 00:00:00 2001 From: Charlie Hoover Date: Thu, 27 Apr 2017 13:32:24 -0400 Subject: [PATCH] [#188] Allow disabling of cache --- README.md | 3 +++ bin/cli.js | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 70eec00..3e2e853 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ node-static =========== + +**THIS FORK ALLOWS FOR DISABLING OF CACHE VIA CLI** + > a simple, *rfc 2616 compliant* file streaming module for [node](http://nodejs.org) node-static understands and supports *conditional GET* and *HEAD* requests. diff --git a/bin/cli.js b/bin/cli.js index f016857..428e829 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -82,7 +82,11 @@ if (argv.version) { process.exit(0); } -if (argv.cache) { +if (argv.cache === 0 || argv.cache) { + var loweredCache = argv.cache.toString().toLowerCase(); + if (loweredCache === 'false' || loweredCache === 'f') { + argv.cache = 0; + } (options = options || {}).cache = argv.cache; }