> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/welcome/global-accelerator/faq/should-i-use-layer-4-or-layer-7-acceleration.md).

# Should I use Layer 4 or Layer 7 acceleration?

The decision to use layer 4 or layer 7 acceleration depends on your specific use case and performance needs.

Layer 4 acceleration is primarily focused on improving network performance by optimizing the transport layer protocols such as TCP and UDP. It can improve the throughput and reduce latency by optimizing network connections, load balancing, and caching. Layer 4 acceleration is typically used for applications that require high network throughput and low latency, such as large file transfers and real-time streaming.

Layer 7 acceleration, on the other hand, is focused on optimizing application performance by analyzing and optimizing application layer protocols such as HTTP, HTTPS, and SSL/TLS. It can improve application performance by optimizing the application payload, reducing server response times, and managing user sessions. Layer 7 acceleration is typically used for web applications and other applications that require high transaction rates and low response times.

So, if your application is mainly focused on network performance and data transfer, layer 4 acceleration may be more appropriate. If your application is focused on optimizing application performance and user experience, then layer 7 acceleration may be the better choice.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.console.zenlayer.com/welcome/global-accelerator/faq/should-i-use-layer-4-or-layer-7-acceleration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
