Hey guys. I’m starting with the javascript SDK imp...
# announcements
b
Hey guys. I’m starting with the javascript SDK implementation so I can do server side feature flag checking on my expressjs backend. As first shot, I added a new “GrowthBook middleware” that creates and setup a new GrowthBook object context for every request that needs a feature flag check. Can you imagine a better memory-optimized solution for an expressjs backend?
f
Are you caching the feature definitions json?
b
Yes, with an in-memory database
f
that should be really fast
b
It actually is. Just wondering if someone comes up with something better than calling
new GrowthBook()
in every request
f
There is a
destroy
method you can use at the end of the request to release some memory back. The instances are extremely lightweight. It's technically possible to reuse instances, but usually not worth the complexity.
b
Thanks both of you for the fast response.