0
0
Nginxdevops~20 mins

Why headers and compression optimize delivery in Nginx - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Compression and Headers Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How do HTTP headers improve content delivery?

Which HTTP header helps browsers cache content to reduce repeated downloads?

AContent-Type
BCache-Control
CContent-Encoding
DAuthorization
Attempts:
2 left
💡 Hint

Think about headers that tell browsers how long to keep files.

💻 Command Output
intermediate
2:00remaining
Identify the effect of gzip compression in nginx

Given this nginx config snippet enabling gzip compression, what will be the Content-Encoding header in the response?

gzip on;
gzip_types text/plain application/json;
AContent-Encoding: gzip
BContent-Encoding: compress
CContent-Encoding: deflate
DNo Content-Encoding header
Attempts:
2 left
💡 Hint

Check which compression method nginx uses when gzip is enabled.

🔀 Workflow
advanced
3:00remaining
Order the steps to enable gzip compression in nginx

Put these steps in the correct order to enable gzip compression for JSON responses in nginx.

A1,3,2,4
B2,1,3,4
C1,2,3,4
D2,3,1,4
Attempts:
2 left
💡 Hint

Think about configuring first, then applying, then testing.

Troubleshoot
advanced
2:30remaining
Why is gzip compression not applied to JSON responses?

After enabling gzip and adding gzip_types application/json;, JSON responses are still not compressed. What is a likely cause?

AThe server is missing Content-Type header
Bgzip is not enabled in nginx.conf
CThe JSON content is too small to compress
DThe client does not send Accept-Encoding: gzip header
Attempts:
2 left
💡 Hint

Compression only happens if the client asks for it.

Best Practice
expert
3:00remaining
Which header combination best optimizes delivery with compression and caching?

Choose the best set of headers to optimize delivery of compressed static files with caching in nginx.

ACache-Control: max-age=31536000, immutable<br>Content-Encoding: gzip
BCache-Control: no-cache<br>Content-Encoding: gzip
CCache-Control: max-age=0<br>Content-Encoding: deflate
DCache-Control: max-age=3600<br>Content-Type: application/json
Attempts:
2 left
💡 Hint

Think about long caching and correct compression header.