Reputation: 71
I'm implementing server to server communications that should (probably) look like this:
client (web browser) <--> (web app) server (service client) <--> (service app) central server
Some of the client requests are processed locally and some are performed as remote service calls (not RPC). Request to central server is formatted as HTTPS POST and then sent using cURL; server replies with appropriate JSON message.
Problem is, I'm using HTTPS and it takes some additional time for certificate verification, each time service query is performed. It's possible to re-use cURL handle and send 'keep-alive' connection header, but.. In current MVC implementation, each new client request results in new instance of web app (and corresponding service client) - meaning, handle is re-initialized and https connection is established anew.
So, the following questions arise:
Thank you!
Upvotes: 4
Views: 1501
Reputation: 99879
Did you measured the overhead of the HTTPS connection ? Is it really significant ?
If you would like to avoid doing the handshake for each request, you could try setting up a persistent secured connection between the server and the central server.
You could do that with a SSH tunnel, a VPN, etc.
Edit: A local reverse HTTP proxy that maintains a keep-alive connection on the central server would be an option too.
Upvotes: 1
Reputation: 21553
Upvotes: 0