how to forward tcp or udp connection is initially not knowing where to contact the client?
For tcp in any way. A TCP connection is characterized by the quadruple (src_ip, src_port, dst_ip, dst_port). Not knowing where to contact the client, the four can not be obtained, and hence forward will not work.
UDP generally the Protocol without connections. Each message (datagram) is sent regardless of previous/next.
need cache, but what exactly to store in it?
The cache stores frequently used data.
As can be seen from the scheme of the problem is high latency on the satellite channel.
Put up a great keepalive and socket timeout.
Actually, I did not understand what is the problem described in the question. If You are writing a reverse proxy, read about how the Directive *upstream in nginx - can cereals diminished.