I understand that require
loads the file only once, while load
loads it every time it is called.
It looks like using require
is preferable in most situations.
My question is, when would I use load
rather than require
?
If you need to force something to reload (a common example would be a web server or a test server). You should use autoload when there is a reasonable chance some piece of code won't get hit, or you want to address app load time issues. You should use require at all other times.