Challenge - 5 Problems
Gzip Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
Check if gzip is enabled in nginx
You run the command
nginx -T | grep gzip to check gzip settings. What output indicates gzip is enabled?Nginx
nginx -T | grep gzip
Attempts:
2 left
💡 Hint
Look for the directive that explicitly turns gzip on without being commented out.
✗ Incorrect
The directive gzip on; enables gzip compression in nginx. If it is commented out or set to off, gzip is disabled.
❓ Configuration
intermediate2:00remaining
Configure gzip to compress only text files
Which nginx configuration snippet correctly enables gzip compression only for text-based files?
Attempts:
2 left
💡 Hint
gzip_types defines which MIME types are compressed. Text files have MIME types like text/plain or text/css.
✗ Incorrect
Option A enables gzip and sets it to compress common text MIME types. Option A tries to compress images which is inefficient. Option A disables gzip. Option A compresses binary streams which is not typical.
❓ Troubleshoot
advanced2:30remaining
Why is gzip not compressing responses?
You enabled gzip in nginx but responses are still not compressed. Which of these is a likely cause?
Attempts:
2 left
💡 Hint
Check if gzip is disabled for certain browsers or clients.
✗ Incorrect
The gzip_disable directive disables gzip for specified user agents. If it matches the client, gzip won't compress responses.
✅ Best Practice
advanced2:00remaining
Optimal gzip buffer size configuration
Which buffer size setting is recommended to optimize gzip compression performance in nginx?
Attempts:
2 left
💡 Hint
Buffers should be moderate size to balance memory and compression efficiency.
✗ Incorrect
Option A uses 4 buffers of 16k each, which is a common recommended setting balancing memory use and performance. Other options use too small or too large buffers.
🔀 Workflow
expert3:00remaining
Order the steps to enable gzip compression in nginx
Put these steps in the correct order to enable gzip compression on an nginx server.
Attempts:
2 left
💡 Hint
You must edit config before testing and reloading.
✗ Incorrect
First edit the config file, then add gzip directives, test syntax, and finally reload nginx to apply.