I am trying to optimize data transfers from the REST API to my conky instance. Internally, conky is using libcurl to perform the operations. I'm doing periodic queries at about 1Hz per endpoint (/api/job, /api/printer, etc.). Curl reports that it is trying to reuse connections, but every time the connection seems to be dead and so it makes a new one. Ideally, connections would not be recreated.
I don't see anything on the conky/libcurl side that would explain this. So how does OctoPrint handle the REST API queries? I can't seem to find the right place to look in the source to get my head around it.