PHP: Keep HTTPS Connection to API open throughout multiple requests

Viewed 2116

I'm writing a plugin for wordpress that needs to call an API for every request the user makes.

These API-calls are done using the HTTPS protocol. Currently, for every new user request, I need to reopen the HTTPS connection.

Yes, curl allows persistent connections (reusing the handle or using the multi handle) but I would like to persist the connection throughout multiple user requests.

So: Is it possible to keep a HTTPS connection open throught multiple PHP processes and reuse it? The alternative would be to let the user's browser to the API-talk. But if it is possible I would like to avoid that.

2 Answers
Related