Challenge - 5 Problems
Cache Purge Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
What is the output of this command to purge cache in Nginx?
You run the following command to purge a cached file in Nginx cache directory:
What is the expected result?
rm -rf /var/cache/nginx/*
What is the expected result?
Nginx
rm -rf /var/cache/nginx/*Attempts:
2 left
💡 Hint
Think about what the wildcard * means in shell commands.
✗ Incorrect
The rm -rf command with * deletes all files and folders inside the specified directory immediately. No age filtering happens.
❓ Configuration
intermediate2:00remaining
Which Nginx configuration snippet enables cache purging via HTTP request?
You want to allow cache purging by sending a special HTTP request to Nginx. Which configuration snippet correctly enables this?
Nginx
location ~ ^/purge(/.*) {
allow 127.0.0.1;
deny all;
proxy_cache_purge my_cache $1;
}Attempts:
2 left
💡 Hint
Remember to restrict purge access to localhost only.
✗ Incorrect
Option A correctly restricts purge access to localhost and uses proxy_cache_purge directive.
❓ Troubleshoot
advanced2:00remaining
Why does the cache not purge after sending a PURGE request?
You configured Nginx to allow PURGE requests to clear cache, but after sending a PURGE request, the cache remains. What is the most likely cause?
Attempts:
2 left
💡 Hint
Check IP restrictions in your purge location block.
✗ Incorrect
If the PURGE request comes from an IP not allowed by 'allow' directive, Nginx denies it silently, so cache is not purged.
🔀 Workflow
advanced2:30remaining
What is the correct workflow to safely purge a specific cached URL in Nginx?
You want to purge the cached content for URL /images/logo.png without affecting other cached files. What is the correct sequence of steps?
Attempts:
2 left
💡 Hint
Think about verifying config before purging and checking logs after.
✗ Incorrect
First verify cache key (2), then send PURGE (1), check logs (3), and reload config last if needed (4).
✅ Best Practice
expert3:00remaining
Which practice is best for purging cached content in a high-traffic Nginx environment?
In a busy production environment, what is the best practice to purge cached content without causing downtime or performance issues?
Attempts:
2 left
💡 Hint
Think about minimizing impact and targeting only needed cache entries.
✗ Incorrect
Option C minimizes impact by purging only changed URLs via controlled HTTP PURGE requests, avoiding downtime.