Are there import caches?

I read somewhere yesterday that workers are initialised during the TLS handshake to basically remove cold starts.

I also read that sometimes isolates are re-used for requests and to not rely on mutable state.

I'm currently playing about with dependency injection and I'm wondering whether it would be beneficial to lazily load "providers" (dynamically import) and cache it in global mutable state, or whether to just import it all upfront. I'm thinking cost-centric.

Thank you!
Was this page helpful?