title: WordPress: Run an action after page sent
body: <p>I want to register all the visits to a certain post in a Wordpress blog. The collected data is sent to an external server where I gather the information of this blog and other sources.</p>
  
  <p>Until now, my way of solving this problem was using the hook <code>wp_footer</code>, adding an asynchronous JSONP call to the remote server. But this way adds a little overhead to the generated HTML, and depends if the user has enabled javascript.</p>
  
  <p>Now, I'm trying to do the same but making the external call through the php code, using curl or any similar library. The problem here is adding lag to the page generation time, that can penalize the user experience. Is there any good way of doing this after the content is sent and the HTTP connection closed? Would be the Wordpress hook <code>shutdown</code> valid?</p>