title: annoyance node.js calls httpserver callback function twice for one single page refresh
body: <p>When loging the OnRequest function below (found in this tut <a href="http://www.nodebeginner.org/" rel="nofollow">http://www.nodebeginner.org/</a>)</p>
  
  <pre><code>var http = require("http");
  
  function onRequest(request, response) {
    console.log("Request received.");
    response.writeHead(200, {"Content-Type": "text/plain"});
    response.write("Hello World");
    response.end();
  }
  
  http.createServer(onRequest).listen(8888);
  
  console.log("Server has started.");
  </code></pre>
  
  <p>log will print "Request received." twice each time I refresh the webpage only once : this is annoying since it means I can have side effects when making some other processing.</p>
  
  <p>Why doesn't node.js mitigate this like other http servers ? </p>
  
  <p><strong>My question is not WHY I know why, my question is HOW to detect that it is second time and avoid calling a heavy processing twice ?</strong></p>