In a NodeJS application, if you include the http module in an application, will that run every time a person visits my application? Or will it only load once on the server and then continually handle client requests without having to include the module again? My reason for asking this is that require is synchronous. In the case of some network applications, or an ad server for example, it would slow down the performance of the application.
Asked
Active
Viewed 76 times
1 Answers
4
It will only load once. The only code (that you write) that executes on a per-request basis is the code that you put into callbacks (e.g. the listener passed into http.createServer
).

arghbleargh
- 3,090
- 21
- 13