Set Redis Key with Expiry (TTL)

Store a key that deletes itself after a 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


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

Free account. Save snippets into your own collections.