1

Is there any option to set the maxSize(in bytes) of the cache or the size limit for the items going to be stored in the in memory cache in nestjs .

My current implementation looks like :

//app module

CacheModule.register({
      max: 100,
      isGlobal: true
    })

// usage 

this.client.set(userId, inputId, { ttl: 600})

I checked the function signature and there were no options available .

Dosank
  • 41
  • 2
  • determining size of the object in bytes isn't very straightforward in node js(and most other languages). Objects can be complex and deeply nested graphs with cycles and stuff. The size of the object (and all of the its subobjects) can change after you inserted it into the cache without obvious way to track it. – ThatAnnoyingDude Feb 25 '22 at 14:48

0 Answers0