A developer is adding caching to a Python application. The application uses the redis (redis-py) library and a client named r that is already connected to an Azure Managed Redis instance. The developer is reviewing the client methods that the application will use for caching and expiration.
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
| Statement | Yes | No |
|---|---|---|
Calling r.setex() stores a string value and sets its expiration time in a single atomic operation.SETEX sets a string value and its expiration time together, atomically. | Correct | |
In the call r.psetex('temp:data', 5000, 'temporary_value'), the key expires after 5,000 seconds.PSETEX takes its expiration in milliseconds, so this key expires after 5,000 milliseconds (5 seconds), not 5,000 seconds. | Correct | |
When r.exists() is called with three key names, it returns True if all three keys exist.With several keys, | Correct |
SETEX writes a string value and its time to live in one atomic step. PSETEX works the same way but takes the expiration in milliseconds, so 5000 means five seconds. When EXISTS is given several keys, it returns a count of the keys that are present. It does not return a Boolean that requires all of them to exist.