Set Redis Key with Expiry (TTL)

Sets a key with an automatic expiry time using EX (seconds) or PX (milliseconds). Expiring keys are the foundation of TTL-based caching.

When you need this: When caching database query results or API responses that should expire after a set time.

Variables

Command


        
2 views 0 copies
Log in to rate
Log in to save

Free account — save snippets into your own collections.