Complete the code to create a cache in Azure using the correct service name.
cache = azure.[1]Client()Azure Redis Cache is the correct service to use for caching to improve performance.
Complete the code to set a cache expiration time in seconds.
cache.set('key', 'value', expiration=[1])
Setting expiration to 3600 seconds means the cache entry lasts for one hour, improving performance by reducing repeated data fetches.
Fix the error in the code to retrieve a cached value safely.
value = cache.get('[1]') or 'default'
The key used to store the value must match the key used to retrieve it. 'key' is the correct consistent key.
Fill both blanks to configure cache connection with correct host and port.
cache = RedisCache(host='[1]', port=[2])
The host must be the Azure Redis Cache endpoint, and the port is typically 6379 for Redis.
Fill all three blanks to implement cache get, set, and delete operations correctly.
cache.[1]('key', 'value') result = cache.[2]('key') cache.[3]('key')
Use set to store, get to retrieve, and delete to remove cache entries.