Логотип Workflow

Article

Browser To Server Flow

Stage 5. Browser to Server Flow

When a user clicks a button in the browser, the request crosses several network and infrastructure layers before backend business logic runs. If you inspect only endpoint code, you may miss the real source of failure. That is why engineers should understand the full path: from browser and DNS to gateway, API service, and the response path back.

Browser to server flow

1. Full Request Chain

A typical path looks like this:

  1. Browser builds the request: URL, method, headers, cookies, body.
  2. DNS resolves the domain to an IP address.
  3. Traffic passes through edge layer: CDN/WAF.
  4. Load Balancer distributes traffic across instances.
  5. API Gateway applies policy: auth, rate limits, routing.
  6. Backend API executes business logic and reads/writes DB or cache.
  7. Response travels back through the chain to the browser.

2. What Each Layer Does

LayerRole in flowCommon failure modes
BrowserBuilds HTTP request and enforces security policiesCORS blocks, cookie policy mismatch, stale cache
DNSResolves domain to IPWrong records, slow lookup
CDN/WAFAccelerates delivery and filters trafficStale cached content, rule-based blocking
Load BalancerDistributes requests to healthy instancesBad health checks, uneven traffic split
API GatewayEnforces token, limits, and routingHeader loss, misconfigured limits
API ServiceRuns business logicCode defects, state conflicts
DB/CacheStores and serves dataTimeouts, outdated data

3. Why 200 OK Does Not Always Mean User Success

Even when backend returns 200, browser policy can still block JavaScript from reading the response. A common case is incomplete CORS headers: API responds technically, but browser hides the body from client code. Users experience "it does not work," while server logs still look healthy.

4. Which Network Components the Request Passes Through

Use this compact map for memory:

flowchart LR
  A[Browser] --> B[DNS]
  B --> C[CDN/WAF]
  C --> D[Load Balancer]
  D --> E[API Gateway]
  E --> F[API Service]
  F --> G[(DB/Cache)]
  G --> F
  F --> E
  E --> D
  D --> C
  C --> A

Real production environments may add more hops, but the core architecture is usually similar: edge, routing, service logic, data layer, and response return path.

5. Layer-by-Layer Debug Checklist

  1. In DevTools, inspect Network, Headers, Timing, and preflight OPTIONS.
  2. Verify actual sent/received headers (Origin, Authorization, Set-Cookie, Cache-Control).
  3. Correlate X-Request-Id across gateway and backend logs.
  4. Check whether CDN/proxy returned stale cached response.
  5. Only then move to endpoint business-code analysis.

Practical scenario

A team observed stable 200 for GET /profile, but SPA still failed to render user data after login. Investigation found that API Gateway was not forwarding Access-Control-Allow-Credentials, so browser blocked response access for cookie-based calls. After fixing CORS policy, invalidating edge cache, and adding an e2e check for this path, behavior became stable. The lesson is direct: web reliability depends on the whole browser-to-server chain, not only endpoint code.

Please login to pass quizzes.

Quiz

Check what you learned

Practice

Interactive practice

Complete tasks and check your answer instantly.