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
I searched existing ideas and did not find a similar one
I added a very descriptive title
I've clearly described the feature request and motivation for it
Feature request
Add support for setting a time-to-live (TTL) value in UpstashRedisCache for the JavaScript implementation. This feature will allow users to define an expiration time for cached items, aligning the functionality with the Python version of UpstashRedisCache.
Motivation
Currently, the Python version of UpstashRedisCache supports the ttl (Time To Live) feature, allowing users to specify expiration times for cached items. However, this functionality is not available in the JavaScript version.
Proposal (If applicable)
I propose adding ttl support to the JavaScript implementation by modifying the set method in UpstashRedisCache as follows:
// class UpstashRedisCachepublicasyncupdate(prompt: string,llmKey: string,value: Generation[]){for(leti=0;i<value.length;i+=1){constkey=getCacheKey(prompt,llmKey,String(i));constserializedValue=JSON.stringify(serializeGeneration(value[i]));if(this.ttl){awaitthis.redisClient.set(key,serializedValue,{ex: this.ttl});}else{awaitthis.redisClient.set(key,serializedValue);}}}
If no one else is already working on this, I would like to start implementing this feature. Please let me know if this sounds good or if there are any additional considerations I should keep in mind. 😊
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Checked
Feature request
Add support for setting a time-to-live (TTL) value in UpstashRedisCache for the JavaScript implementation. This feature will allow users to define an expiration time for cached items, aligning the functionality with the Python version of UpstashRedisCache.
Motivation
Currently, the Python version of
UpstashRedisCache
supports thettl
(Time To Live) feature, allowing users to specify expiration times for cached items. However, this functionality is not available in the JavaScript version.Proposal (If applicable)
I propose adding ttl support to the JavaScript implementation by modifying the set method in
UpstashRedisCache
as follows:If no one else is already working on this, I would like to start implementing this feature. Please let me know if this sounds good or if there are any additional considerations I should keep in mind. 😊
Beta Was this translation helpful? Give feedback.
All reactions