I have a few sites' configurations that make use of my custom "myModule.lua" module. I call require("myModule") and then able to use a function from there, called "replaceResource()".
So then from inside the *.conf file, inside "body_filter_by_lua" I make use of the said function.
I use require, because I read it only reads the module from the disk once and then just references it upon following requires.
I now added a new experimental configuration and added "myTestModule.lua" module, which I "require" from the body_filter_by_lua instead of myModule.
myTestModule Has the same function, but a different version of it.
I have noticed that after a number of iteration the new experimental configuration starts to encounter errors as it tries instead of intended "myTestModule" it uses "myModule"'s version of the function.
I solved this particular issue by just renaming the experimental function, BUT I am now in doubts that I may be doing something wrong?
What is the appropriate and efficient way of loading modules to avoid encountering same problems in the future?
So "replaceResource()" should come from the "myTestModule.lua", but it uses one from the "myModule.lua".
Sorry for the long and kind of a theoretical question.