in reply to How to cache a socket in cgi programming?
How often does the remote server update its records, and do you need real-time data? One option would be to just request the newest records every so often and store a copy of the database on your system, where it can be accessed locally.