Chunked transfer encoding is a way to send data in pieces (chunks) without knowing the total size beforehand. nginx uses it to stream data to clients efficiently.
Click to reveal answer
beginner
How does nginx enable streaming responses to clients?
nginx streams responses by sending data as it is generated, often using chunked transfer encoding, so clients start receiving data immediately without waiting for the full response.
Click to reveal answer
intermediate
Which nginx directive controls chunked transfer encoding for proxied responses?
The directive is proxy_http_version 1.1; combined with chunked_transfer_encoding on; to enable chunked transfer for proxied HTTP/1.1 responses.
Click to reveal answer
beginner
Why is chunked transfer encoding useful for large or dynamic content?
It allows sending data as it is produced without waiting for the entire content size, reducing latency and memory use on the server.
Click to reveal answer
intermediate
What happens if chunked transfer encoding is disabled in nginx for streaming content?
nginx will buffer the entire response before sending it, causing delays and higher memory use, which can slow down client experience.
Click to reveal answer
What HTTP version must nginx use to support chunked transfer encoding?
AHTTP/3
BHTTP/1.1
CHTTP/2
DHTTP/1.0
✗ Incorrect
Chunked transfer encoding is part of the HTTP/1.1 standard, so nginx must use HTTP/1.1 to support it.
Which nginx directive enables chunked transfer encoding for proxy responses?
Achunked_transfer_encoding off;
Bproxy_pass_request_body off;
Cproxy_buffering off;
Dproxy_http_version 1.1;
✗ Incorrect
Setting proxy_http_version 1.1; is required to enable chunked transfer encoding for proxied responses.
What is the main benefit of streaming data with chunked transfer encoding?
ASend data immediately without waiting for full content size
BCompress data before sending
CEncrypt data during transfer
DCache data on the server
✗ Incorrect
Chunked transfer encoding allows sending data in parts immediately, improving responsiveness.
If chunked transfer encoding is off, what does nginx do before sending the response?
ABuffers the entire response
BSends data in chunks
CDrops the connection
DCompresses the response
✗ Incorrect
Without chunked transfer encoding, nginx buffers the full response before sending it.
Which scenario benefits most from chunked transfer encoding?
ARedirecting URLs
BServing small static files
CStreaming live video
DServing cached pages
✗ Incorrect
Streaming live video benefits from chunked transfer because data is generated continuously and sent immediately.
Explain how nginx uses chunked transfer encoding to improve streaming performance.
Think about how data can be sent piece by piece instead of waiting for everything.
You got /4 concepts.
Describe the nginx configuration needed to enable chunked transfer encoding for proxy responses.
Focus on HTTP version and chunked transfer directives.
You got /3 concepts.
Practice
(1/5)
1. What is the main purpose of enabling chunked transfer encoding in nginx streaming?
easy
A. To block the client from receiving partial data
B. To compress all data before sending it to the client
C. To send data in smaller parts so the client can start processing early
D. To cache the entire response before sending it
Solution
Step 1: Understand chunked transfer encoding
Chunked transfer encoding breaks the response into smaller pieces called chunks.
Step 2: Identify the benefit in streaming
This allows the client to start receiving and processing data immediately without waiting for the full response.
Final Answer:
To send data in smaller parts so the client can start processing early -> Option C
Quick Check:
Chunked transfer = send data in parts [OK]
Hint: Chunked transfer means sending data in parts, not all at once [OK]
Common Mistakes:
Thinking chunked transfer compresses data
Assuming chunked transfer caches full response
Believing chunked transfer blocks partial data
2. Which nginx directive disables response buffering to enable streaming with chunked transfer?
easy
A. proxy_buffering off;
B. chunked_transfer on;
C. streaming_enable yes;
D. buffer_response off;
Solution
Step 1: Identify the directive for buffering control
In nginx, proxy_buffering controls whether responses are buffered.
Step 2: Find the correct syntax to disable buffering
But streaming is slow and client waits for full response. What is the likely issue?
medium
A. Missing gzip on directive slows down streaming
B. proxy_buffering off causes buffering and delays streaming
C. proxy_pass directive is missing, so no backend connection
D. chunked_transfer_encoding off disables chunked streaming, causing delay
Solution
Step 1: Understand effect of chunked_transfer_encoding off;
Disabling chunked transfer means data is sent as one block, not in parts.
Step 2: Analyze impact on streaming
Without chunked transfer, client waits for full response before receiving data, causing delay.
Final Answer:
chunked_transfer_encoding off disables chunked streaming, causing delay -> Option D
Quick Check:
Chunked off = no streaming chunks [OK]
Hint: Chunked transfer must be on for streaming, else client waits [OK]
Common Mistakes:
Thinking proxy_buffering off causes buffering
Assuming gzip affects chunked streaming
Ignoring missing proxy_pass as cause
5. You want to stream a live video feed through nginx using chunked transfer. Which combination of directives correctly enables streaming with chunked transfer and disables buffering?
hard
A. proxy_buffering off; chunked_transfer_encoding on;
B. proxy_buffering on; chunked_transfer_encoding off;
C. proxy_buffering off; chunked_transfer_encoding off;
D. proxy_buffering on; chunked_transfer_encoding on;
Solution
Step 1: Disable buffering for immediate data forwarding
Set proxy_buffering off; to prevent nginx from waiting to buffer full response.
Step 2: Enable chunked transfer encoding for partial data sending
Set chunked_transfer_encoding on; to send data in chunks to the client.
Final Answer:
proxy_buffering off; chunked_transfer_encoding on; -> Option A