Recall & Review
beginner
What does the
gzip directive do in nginx?It enables or disables gzip compression for responses sent by the nginx server to clients.
Click to reveal answer
beginner
What is the purpose of the
gzip_types directive in nginx?It specifies the MIME types of responses that should be compressed using gzip.
Click to reveal answer
intermediate
How does the
gzip_min_length directive affect gzip compression in nginx?It sets the minimum size in bytes of a response that will be compressed. Responses smaller than this size will not be compressed.
Click to reveal answer
beginner
Give an example of a valid
gzip_types configuration line in nginx.gzip_types text/plain application/json application/javascript text/css;
Click to reveal answer
intermediate
Why might you want to set a higher
gzip_min_length value?To avoid compressing very small files where compression overhead might make the response larger or slow down delivery.
Click to reveal answer
What does the
gzip_types directive control in nginx?✗ Incorrect
The gzip_types directive specifies which MIME types should be compressed by nginx.
If
gzip_min_length is set to 1000, what happens to a 500-byte response?✗ Incorrect
Responses smaller than gzip_min_length are not compressed.
Which directive enables gzip compression in nginx?
✗ Incorrect
The directive to enable gzip compression is simply 'gzip on;'.
Which of these MIME types is commonly included in
gzip_types?✗ Incorrect
application/javascript is a text-based MIME type suitable for gzip compression.
What is a reason to exclude very small files from gzip compression using
gzip_min_length?✗ Incorrect
Compression overhead can make very small files larger or slow to deliver, so they are often excluded.
Explain how to configure nginx to compress JSON and CSS files only if they are larger than 500 bytes.
Think about enabling gzip, specifying types, and setting minimum length.
You got /3 concepts.
Describe why setting the correct
gzip_min_length value is important for web performance.Consider the trade-off between compression benefits and overhead.
You got /4 concepts.