0
0
Azurecloud~10 mins

Why caching improves performance in Azure - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a cache in Azure using the correct service name.

Azure
cache = azure.[1]Client()
Drag options to blanks, or click blank then click option'
ABlobStorage
BVirtualMachine
CSQLDatabase
DRedisCache
Attempts:
3 left
💡 Hint
Common Mistakes
Using storage or database services instead of cache.
2fill in blank
medium

Complete the code to set a cache expiration time in seconds.

Azure
cache.set('key', 'value', expiration=[1])
Drag options to blanks, or click blank then click option'
A3600
B0
C-1
DNone
Attempts:
3 left
💡 Hint
Common Mistakes
Setting expiration to zero or negative disables caching.
3fill in blank
hard

Fix the error in the code to retrieve a cached value safely.

Azure
value = cache.get('[1]') or 'default'
Drag options to blanks, or click blank then click option'
Avalue_key
Bmissing_key
Ckey
Dcache_key
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different or incorrect key name.
4fill in blank
hard

Fill both blanks to configure cache connection with correct host and port.

Azure
cache = RedisCache(host='[1]', port=[2])
Drag options to blanks, or click blank then click option'
Amycache.redis.cache.windows.net
B6379
Clocalhost
D8080
Attempts:
3 left
💡 Hint
Common Mistakes
Using localhost or wrong port numbers.
5fill in blank
hard

Fill all three blanks to implement cache get, set, and delete operations correctly.

Azure
cache.[1]('key', 'value')
result = cache.[2]('key')
cache.[3]('key')
Drag options to blanks, or click blank then click option'
Aset
Bget
Cdelete
Dupdate
Attempts:
3 left
💡 Hint
Common Mistakes
Using update instead of delete or wrong method names.