# Latency

Latency is the time delay between a request being sent and the response being received. In networking and API contexts, it is typically measured in milliseconds and represents the total round-trip time for a request to travel from the client to the server and back.

API latency is affected by multiple factors: network distance between client and server, DNS resolution time, TLS handshake duration, server processing time, database query execution, and response payload size. High latency degrades user experience, especially in interactive applications and real-time systems.

Reducing API latency is a primary motivation for edge computing and edge-deployed API gateways. By processing requests at the network edge closest to the user, several latency-contributing factors are minimized. Techniques for lowering latency include response caching, connection pooling, payload compression, and geographic routing. API gateways can measure and report latency metrics, helping teams identify bottlenecks in their request processing pipeline.


---

# Agent Instructions: 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:

```
GET https://docs.serverlessapigateway.com/glossary/l/latency.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
