You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating an instance of the cache this should help: myCache.options.useClones = false;
By default node-cache creates deep clones of each object you set, so a large object will take much longer to be deep cloned than a large string.
Take in mind that if you set this option to false, if for some reason you need to store the same object twice under different keys, both objects will have the same reference, and change in one will affect the other.
You can avoid this by doing the deep cloning yourself when needed.
@LiveGood thanks, this helped with my issue. Was querying 125k rows over 4 columns and it would take 11s to return from cache (slower than if I would query API directly). After turning this to false it's getting it from cache in <500ms.
I have noticed that it takes really long time when i add and retrieve data that is a json array (25k elements).
If I stringily the obj its 10x faster.
any recommendation instead of stringily and then parse?
"node-cache": "^5.1.2"
node ver : v16.14.2
thanks
The text was updated successfully, but these errors were encountered: