Challenge - 5 Problems
Proxy Cache Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of this Nginx cache status header?
You have configured Nginx with proxy_cache and added the header
X-Cache-Status to responses. After a client requests a cached resource twice, what will be the value of X-Cache-Status in the second response?Nginx
proxy_cache_path /tmp/cache levels=1:2 keys_zone=mycache:10m max_size=1g inactive=60m; server { location / { proxy_cache mycache; proxy_pass http://backend; add_header X-Cache-Status $upstream_cache_status; } }
Attempts:
2 left
💡 Hint
Think about what happens when a cached response is served again.
✗ Incorrect
The first request will be a MISS because the cache is empty. The second request will be served from cache, so the header will be HIT.
❓ Configuration
intermediate2:00remaining
Which configuration snippet correctly sets up proxy cache with a 30-minute inactive timeout?
You want to configure Nginx proxy cache to store cached files and remove them if they are not accessed for 30 minutes. Which snippet correctly sets this?
Attempts:
2 left
💡 Hint
The inactive parameter uses time units like s, m, h for seconds, minutes, hours.
✗ Incorrect
The inactive=30m means cached files not accessed for 30 minutes will be removed. Other options use wrong units or too long/short times.
❓ Troubleshoot
advanced2:00remaining
Why does Nginx not cache responses despite proxy_cache configured?
You configured proxy_cache in Nginx, but responses are never cached. Which reason below explains this behavior?
Attempts:
2 left
💡 Hint
Check what response headers from backend can prevent caching.
✗ Incorrect
If backend sends Cache-Control: no-store, Nginx will not cache the response regardless of proxy_cache settings.
🔀 Workflow
advanced2:00remaining
What is the correct order of steps to enable proxy caching in Nginx?
Arrange these steps in the correct order to enable proxy caching in Nginx.
Attempts:
2 left
💡 Hint
Think about defining cache first, then enabling it, then proxying, then headers.
✗ Incorrect
First define cache path, then enable cache in location, then set proxy_pass, finally add headers.
✅ Best Practice
expert2:00remaining
Which option is the best practice to avoid caching sensitive user data in Nginx proxy cache?
You want to ensure Nginx proxy cache does not store responses containing sensitive user data. Which configuration is best?
Attempts:
2 left
💡 Hint
Think about bypassing cache selectively based on user state.
✗ Incorrect
Using proxy_cache_bypass with conditions like checking cookies allows caching public content but bypasses cache for logged-in users, protecting sensitive data.