Conversation
|
What is rationable behind? |
|
The Reader performs a lot of API calls for article metadata. This optimisation should improve response time because this keeps sockets open for next calls, i.e. there is no need to TCP handshake all over again. |
viktor-yakubiv
left a comment
There was a problem hiding this comment.
Why could not you do this just passing Keep-Alive: 'timeout=60000, max=1000 header to axios?
|
AgentKeepAlive library allows to have pool of free sockets and has more parameters to tweak I would say. |
|
I don't see any other option for this library to work in the browser where you cannot have any control of the connection pool apart having the header I wrote about. Also, I am not sure it's possible to reuse XMLHttpRequest instance and pretty sure it's not possible to reuse Fetch API promise. |
|
This is only for node. I tested it in browser and API worked fine. I guess Axios handles it somehow and disables agent for browser. We don't have this issue in the browser so it's fine as-is for now. |
|
Thank you for the explanation |
No description provided.