I observed a wierd behavior on my NodeJS server running on my localhost (my macbook). Initially I have my wifi on (Internet is ON), then I send a request to my server GET /jobHistory -> All the request to static files are logged (using morgan JS), and I can see it takes about 300-400ms for every static files.
I turn OFF the wifi (Internet is OFF), I have to restart my NodeJS server (otherwise it will be idle - not sure why). I send another GET /jobHistory -> Now all the request to static files only takes about 5ms-10ms per file, much faster than what I observed.
If you have any clue on this, please enlighten me, or tell me how could I investigate further. This seems to be some important point about NodeJS server that I missed...