Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dns caching in request module - node.js

In my project I do a big amount of request to the same url using the 'request' module. For some reason a lot of the request go to the dns server in order to resolve the url address instead of having some sort of caching for this. Is there some kind of built-in mechanism in the 'request' module to resolve this? Or any other solution?

Thanks!

like image 680
oded betzalel Avatar asked Feb 06 '23 02:02

oded betzalel


1 Answers

This question is a little old so you may have already found an answer, but I just had this problem and used the dnscache module to handle it. We had a high amount of IO (Node reading /etc/resolv.conf), and this module seemed to handle the problem. I couldn't find anything in Request's or Node's source to handle that problem, but did find this related issue.

like image 91
Zac Anger Avatar answered Feb 08 '23 15:02

Zac Anger