Overview - Keepalive connections
What is it?
Keepalive connections allow a client and server to reuse the same network connection for multiple requests instead of opening a new one each time. In nginx, this means the server keeps the connection open after sending a response, so the client can send more requests quickly. This reduces the time and resources spent on repeatedly establishing connections. It is especially useful for websites with many small requests, like images or scripts.
Why it matters
Without keepalive connections, every request would need a new connection, causing delays and extra load on servers and networks. This slows down websites and wastes resources, making user experiences worse. Keepalive connections make websites faster and servers more efficient, which is crucial for handling many users smoothly.
Where it fits
Before learning keepalive connections, you should understand basic HTTP requests and how nginx handles connections. After this, you can learn about connection pooling, load balancing, and advanced nginx performance tuning.