~/talk

Solving Real-World Data Fetching Challenges with Next.js and TanStack Query: Case Study

Talkat Voxxed Days Zürich 2025 · on Tuesday, 2025-03-25· [frontend-architecture, react]
slides:none on file

Front end needs birthdays for 5,000 users but backend only returns 1,000 per call, initial client does five parallel requests and receives ~2.3 MB responses with ~73% unused data causing slow loads and 429s. A Next.js API handler BFF aggregates the five calls, maps data and returns a tiny payload of 666 bytes, while TanStack Query provides caching, retries, prefetch/dehydrate and client recovery with server-side timeouts (e.g. 500ms–2.5s), turning multi-second loads into millisecond renders.

AI-written summary · about

  1. 0:00Introduction
  2. 1:26Data fetching performance
  3. 3:11Pragmatic optimization
  4. 4:56Real-world suboptimal conditions
  5. 7:24TCP packet limit matters
  6. 7:46Next.js and TanStack Query
  7. 10:58API types and limits
  8. 12:42Problem statement and constraints
  9. 14:25Initial architecture flaws
  10. 17:13Demo: Unoptimized fetching
  11. 19:17Issues with initial approach
  12. 20:01Backend for Frontend pattern
  13. 22:47Optimized architecture with BFF
  14. 23:30Demo: Optimized fetching
  15. 25:35Ingress vs egress costs
  16. 28:22TanStack Query for UX
  17. 31:49Query criticality and resilience
  18. 33:14Server-side prefetching
  19. 35:21Prefetch logic in Next.js
  20. 37:49Demo: Server-side prefetching
  21. 39:55React reconciliation optimization
  22. 42:30Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.