Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache cannot be disabled with cli #188

Open
cphoover opened this issue Apr 27, 2017 · 4 comments
Open

Cache cannot be disabled with cli #188

cphoover opened this issue Apr 27, 2017 · 4 comments

Comments

@cphoover
Copy link

cphoover commented Apr 27, 2017

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.

cphoover added a commit to cphoover/node-static that referenced this issue Apr 27, 2017
cphoover added a commit to cphoover/node-static that referenced this issue Apr 27, 2017
@cphoover
Copy link
Author

Fixed by PR: #189

cphoover added a commit to cphoover/node-static that referenced this issue Apr 27, 2017
cphoover added a commit to cphoover/node-static that referenced this issue Apr 27, 2017
@jakubwolny
Copy link

jakubwolny commented Nov 29, 2017

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

@elliotrodriguez
Copy link

seconded - can we get the PR merged?

@klebba
Copy link

klebba commented Jan 3, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants