Asynchronous Requests in PHP
I recently wrote an API callback script that performed some heavy calculations and took a long time to return. To keep the user from having to wait, I wanted to have the script immediately return cached results and asynchronously process the calculations. There are a few partial solutions on the web but none of them properly deal with sites using HTTPS, so here's my solution: