Cache cannot be disabled with cli
I'm trying to disable cache in the CLI
I've tried
static -c 0 ., static -c false ., static -c 0 ., and static --cache=false .
None of these combinations work.
Fixed by PR: https://github.com/cloudhead/node-static/pull/189
Any updates here? can this PR be merged? if not, can you please give us a hint how to disable cache in CLI mode? The best I got so far was:
static -H '{"Cache-Control": "no-cache, must-revalidate"}'
then as a result I had 2 headers in the response:
Cache-Control: no-cache, must-revalidate
cache-control: max-age=3600
which is a bit confusing
seconded - can we get the PR merged?
The programmatic cache option is weird too:
const st = require('node-static');
const fileServer = new st.Server(path, {
cache: 0,
headers: {
'Cache-Control': 'no-cache, must-revalidate',
},
});
Results in dual cache-control headers as well, like:
cache-control: max-age=0
Cache-Control: no-cache, must-revalidate
While the CLI seems to interpret static -c 0 as a falsy value, and falls back to the default, resulting in:
cache-control: max-age=3600