Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

Redis String: SETEX

SETEX key seconds value

The Redis SETEX command is used to set some string value with specified timeout in seconds in redis key.

Syntax:

SETEX KEY_NAME TIMEOUT VALUE

Available since

2.0.0.

Return Value

Simple string reply. OK, if the value is set to key or Null if the value does not set.

Return Value Type

String

Example: Redis SETEX

redis 127.0.0.1:6379> SETEX mykey 60 redis
OK
redis 127.0.0.1:6379> TTL mykey
60
redis 127.0.0.1:6379> GET mykey
"redis

Previous: SETBIT
Next: SETNX