0
0
Nginxdevops~5 mins

Gzip compression in Nginx - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is Gzip compression in the context of nginx?
Gzip compression is a method used by nginx to reduce the size of files sent from the server to the client, making web pages load faster by compressing text-based content like HTML, CSS, and JavaScript.
Click to reveal answer
beginner
Which nginx directive enables Gzip compression?
The directive gzip on; enables Gzip compression in the nginx configuration.
Click to reveal answer
intermediate
What does the gzip_types directive do in nginx?
The gzip_types directive specifies which MIME types should be compressed by Gzip, such as text/html, application/javascript, and text/css.
Click to reveal answer
beginner
How can you check if Gzip compression is working on your website?
You can check Gzip compression by using browser developer tools or online tools that inspect response headers for Content-Encoding: gzip, indicating the content is compressed.
Click to reveal answer
intermediate
What is the purpose of the gzip_min_length directive?
The gzip_min_length directive sets the minimum size of a response that will be compressed. Responses smaller than this size will not be compressed to avoid overhead.
Click to reveal answer
Which nginx directive turns on Gzip compression?
Agzip on;
Bgzip_enable;
Cenable_gzip;
Dcompression on;
What type of content is typically compressed by Gzip in nginx?
AImages like PNG and JPEG
BBinary executable files
CVideo files
DText-based files like HTML, CSS, and JavaScript
Which header indicates that the response is compressed with Gzip?
AContent-Encoding: gzip
BContent-Type: gzip
CEncoding: gzip
DCompression: gzip
What does the gzip_min_length directive control?
AMaximum size of files to compress
BMinimum size of files to compress
CCompression level
DTimeout for compression
If you want to compress JSON responses, which directive should you configure?
Agzip_json on;
Bgzip_include json;
Cgzip_types application/json;
Dgzip_enable json;
Explain how to enable and configure Gzip compression in nginx for a website.
Think about the main directives and the steps to activate compression.
You got /4 concepts.
    Describe how you can verify that Gzip compression is working correctly on your web server.
    Focus on tools and headers that show compression status.
    You got /3 concepts.