Original post

Using a web server as an example, there are multiple stages you can load resources. Within the main() function and within the handler are the obvious two – each with their own advantages and disadvantages. Within the main function can hinder the start-up time of the server, while code within the handler is run on every request.
Sometimes we want to load a resource only once and when it’s first needed.