I'm writing a gateway script in PHP which connects to a remote server, obtains some information and returns it for JSON usage (no JSONP possibility).
This gateway is being requested every second, so it's very important for curl
to use keep-alive. From what I learned, curl
will do it automatically if we will use the same handle across multiple requests.
The question is: how do I store the handle between two reloads? It's not possible to store the handle resource in session, it also can't be serialized.
Or maybe there's other way to ensure keep-alive in curl?