Closed mix3d closed 6 years ago
Same for me. Working on an angular app and some local template changes simple don't propogate without a server restart.
I was having an issue with stale content, but I think it may have been down to expecting the order of args to be other than they are documented.
http-server tests/results -c-1
works for me, whilst:
http-server -c-1 tests/results
..does not. hth
(I find the order of arguments inconsistent with other CLI utilites... )
http-server -h
for help..
Confirming order of args does matter and @ptim's solution of putting -c-1
at the end works. Thanks!
I ran into this issue today with my https://github.com/capaj/jspm-react
My files are always loading cached. Only way to get a fresh version is to check Disable cache (while DevTools is open)
and leave it opened.
I even run http server with cache set to -1 and it still loads cached files.
@czpilar I got this problem too on windows!!!
Same problem. Changing template files in angular does not update the content on refresh.
adding -c-1 at the end worked for me. Thanks
"-c-1" does not work without "-a localhost -p 8000".
@ujulitos This worked for me. Thanks!
It seems like changing the port + adding "-c-1" made it for me indeed. A simple "http-server -c-1 -p 8010" should work. Consider using a port you did not used before.
Since many people use this as a development server, I don't think it would be unreasonable to default no disabling all caching. Or at least support ETag's.
'http-serve -o -o' worked for me.
"http-server -c-1 -p 8010" worked for me, but "http-server -c-1" did not. Thanks for posting solutions everyone <3
http-server -c-1
is not working because it is already cached your content at the default port 8080
, you have to change to different port with option -c-1
.
> http-server -c-1 -p 8000
@NathanLebonCGI that worked. Thanks.
@radin-reth Do you know how to clear cache on a specific port?
This worked for me: http-server -c-1 -p 8010
We've also recently added a note to the README https://github.com/indexzero/http-server/commit/b9b95b25eaf90993b2406555a2f56c3a8cc9072f which I hope sufficiently clears up confusion for new comers.
I'm closing this as there's no clear remaining actions to take.
However, if anyone has new caching related concerns please file an issue (ideally with tests! 😁).
Thanks, all! 🎩
crtl+reload helped me
@BigBlueHat I dont think its sufficient. I tested this with -c-1 and it only forces cache clear with -p 8000 (for example) port specification. Just like a few others in this thread have already mentioned. In other words, I would recommend either the bug be reopened or re-evaluated. I have not seen any comments confirming that simply -c-1 without a port specification works for them.
let me clarify what I just said:
if you put the port specification, then -c-1 will work. If you don't put the port specfication, -c-1 will not work.
"http-server -c-1 -p 8010" worked for me, but "http-server -c-1" did not. Thanks for posting solutions everyone <3
I just did achive after put other port.
http-server path/to/folder -c-1 -p xxxx
I was using -p
parameter already and setting -c-1
alone wasnt enough, but then I hard reloaded the page and it worked.
I'm developing a Backbone based app, and the text.js package of require.js appears to be creating a conflict with how files are returned.
If I change one of the template files that is read by text.js, and refresh the page, the content is not updated accordingly; the template file is cached, even with a "hard refresh". Nothing short of forcing a "Empty cache and hard refresh" (right click on refresh button in chrome) will update correctly.
I have tried the -c-1 and -c0, even -c1 params to set the caching parameters when starting, but to no avail.