Hacker News new | ask | show | jobs
by joosters 3036 days ago
An actual ping would be more impressive :)

Perhaps to be less wasteful, the HTTP request should be a HEAD instead of GET? There’s little point downloading a whole page if you are going to just throw away the contents...

1 comments

actually, it's not. We create a special page, with PHP and one with nodejs, that just replies '1', so besides status, we also get a notice if nodejs or PHP malfunctions (which does happen on some servers, 1-2 time a year).
HEAD is still less wasteful and just as effective.
You can still do all that with HEAD, the only difference is you don't return a message body, thus saving 1 byte plus a few in the actual header you would not need any more.

For example; you would do a head request and node.js and php would still need to be configured to handled the HEAD request but instead of its handler returning "1" it would simply return.