You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
consider this : i have a jsvascript file (cmd5.js), it is a little bigger
when i call the method in this file using below code;
I am doubtful about that the mothod will reload cmd5.js everytime, so this is less efficient;
how to be more efficient
It doesn't reload your file every time :) We keep the same Node instance alive (unless it has to restart because a .js file on disk changed), and Node itself keeps the modules' compiled code in memory for reuse every time that module is referenced.
So, in effect, it's already cached in the way you want.
Activity
SteveSandersonMS commentedon Nov 25, 2016
It doesn't reload your file every time :) We keep the same Node instance alive (unless it has to restart because a
.jsfile on disk changed), and Node itself keeps the modules' compiled code in memory for reuse every time that module is referenced.So, in effect, it's already cached in the way you want.