0
0
Nginxdevops~10 mins

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

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

Complete the code to enable gzip compression in nginx.

Nginx
gzip [1];
Drag options to blanks, or click blank then click option'
Aon
Bdisable
Coff
Denable
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'off' disables compression.
Using 'disable' or 'enable' are invalid values.
2fill in blank
medium

Complete the code to set the Content-Encoding header for gzip compressed responses.

Nginx
add_header Content-Encoding [1];
Drag options to blanks, or click blank then click option'
A"deflate"
B"identity"
C"compress"
D"gzip"
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'deflate' or 'compress' when gzip is enabled.
Using 'identity' disables encoding.
3fill in blank
hard

Fix the error in the gzip_types directive to compress CSS and JavaScript files.

Nginx
gzip_types [1];
Drag options to blanks, or click blank then click option'
Atext/css application/javascript
Btext/css; application/javascript
Ctext/css, application/javascript
Dtext/css application/javascript;
Attempts:
3 left
💡 Hint
Common Mistakes
Using commas or semicolons between MIME types.
Adding trailing semicolons inside the directive value.
4fill in blank
hard

Fill both blanks to set caching headers for static files to optimize delivery.

Nginx
location /static/ {
    expires [1];
    add_header Cache-Control "[2]";
}
Drag options to blanks, or click blank then click option'
A30d
Bmax-age=2592000
Cno-cache
Dno-store
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'no-cache' or 'no-store' disables caching.
Mixing commas or wrong syntax in directives.
5fill in blank
hard

Fill all three blanks to configure gzip compression with minimum file size and buffer settings.

Nginx
gzip on;
gzip_min_length [1];
gzip_buffers [2] [3];
Drag options to blanks, or click blank then click option'
A1000
B4
C8k
D1024
Attempts:
3 left
💡 Hint
Common Mistakes
Using buffer size without unit.
Setting gzip_min_length too low or too high.