0
0
Nginxdevops~10 mins

Cache validity rules in Nginx - Interactive Code Practice

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

Complete the code to set the cache validity time to 10 minutes.

Nginx
proxy_cache_valid 200  [1];
Drag options to blanks, or click blank then click option'
A5m
B30s
C1h
D10m
Attempts:
3 left
💡 Hint
Common Mistakes
Using seconds instead of minutes like '30s'.
Setting too long cache time like '1h' when 10 minutes is required.
2fill in blank
medium

Complete the code to cache responses with status 404 for 1 minute.

Nginx
proxy_cache_valid [1] 1m;
Drag options to blanks, or click blank then click option'
A404
B301
C500
D200
Attempts:
3 left
💡 Hint
Common Mistakes
Using 200 instead of 404.
Using 301 which is a redirect status.
3fill in blank
hard

Fix the error in the cache validity rule to cache all responses for 5 minutes.

Nginx
proxy_cache_valid [1] 5m;
Drag options to blanks, or click blank then click option'
Aany
Ball
Cevery
Dall_status
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'all' or 'every' which are not valid keywords.
Using 'all_status' which is not recognized.
4fill in blank
hard

Fill both blanks to cache 301 and 302 responses for 30 minutes.

Nginx
proxy_cache_valid [1] 30m;
proxy_cache_valid [2] 30m;
Drag options to blanks, or click blank then click option'
A301
B404
C302
D500
Attempts:
3 left
💡 Hint
Common Mistakes
Using 404 or 500 which are not redirects.
Mixing the order of status codes.
5fill in blank
hard

Fill all three blanks to cache 200 responses for 15 minutes, 404 for 5 minutes, and any other status for 1 minute.

Nginx
proxy_cache_valid [1] 15m;
proxy_cache_valid [2] 5m;
proxy_cache_valid [3] 1m;
Drag options to blanks, or click blank then click option'
A200
B404
Cany
D500
Attempts:
3 left
💡 Hint
Common Mistakes
Using 500 instead of 'any' for the last blank.
Mixing the order of status codes.