Performance optimization
Now that we have sufficiently covered what HTTP is, its applicability to Java, and some techniques and best practices, let’s consider performance-related issues specific to using HTTP with Java. Our goals for looking at performance issues are to enhance the user experience and improve our application’s scalability, resilience, and maintainability.
Let’s look at seven specific areas regarding performance optimization when using HTTP in our Java applications:
- The first area focuses on the HTTP client. When using HTTP clients, we want to use them efficiently. Here are three techniques for doing that:
- We discussed connection pooling in Chapter 10, Connection Pooling, and can apply those same principles to HTTP connections. This can help reduce the computational overhead and improve performance. The
HttpClient
library includes support for connection pooling. - We can use
HTTP Keep-Alive
to keep connections open for multiple requests to...
- We discussed connection pooling in Chapter 10, Connection Pooling, and can apply those same principles to HTTP connections. This can help reduce the computational overhead and improve performance. The