I am using NodeJS6.10 in my Lambda functions. My function instantiates an object as part of the code and in my object's constructor, I am writing to the log file.
It seems that subsequent invocations of the same Lambda function don't invoke the object's constructor. It is as if it is cached somehow. I only see the log from the constructor once.
Every now and then, the cache seems to expire and the following Lambda call WILL invoke the object's constructor.
Is this behaviour normal? How can I control such caching?
Thanks