Caching, Payloads, and Other Dark Arts: Optimizing UX in Suboptimal Conditions

Bookmark
Rate this content

What do you do when your product’s performance crumbles, but the APIs you work with are out of your control?

This was the reality we faced while building a fintech payments dashboard. Massive payloads, strict compliance, and scattered APIs were slowing merchants down and wrecking workflows.

In this talk, I’ll walk through our real-world quest to rescue the user experience by leaning on full-stack frameworks like NextJS, and others that let you design effective API handlers and proxies. You’ll see how we profiled true bottlenecks, built a Backend-for-Frontend layer to reshape data, balanced API criticality across the stack, applied caching and resilience architectural strategies.

We’ll also look at the infrastructure side: how to use FaaS/IaaS to manage network constraints, reduce payload impact, and improve reliability without changing the source APIs.

Expect live demos, battle-tested patterns, and hard-earned lessons for building resilient, user-centric apps, front to back, even when the odds aren't on your side.

This talk has been presented at React Summit US 2025, check out the latest edition of this React Conference.

FAQ

Developers face challenges such as high latency, unreliable networks, mixed device quality, stale data, and flaky APIs. These factors complicate data fetching and management, making it difficult to create a seamless user experience.

Amazon conducted a study in 2006 which found that a 100-millisecond increase in page load time resulted in a 1% decrease in sales, equating to significant revenue loss. This highlights the importance of optimizing user experience to maintain sales and revenue.

For optimal user experience, rendering should occur within 0 to 2 seconds. Specifically, 0.1 seconds for instantaneous system reaction, 1 second to maintain user flow, and no more than 10 seconds to keep user attention.

The 14-kilobyte rule refers to the optimal size for a data payload to fit within a single initial congestion window for network requests, minimizing round trips. Staying within this limit can significantly reduce load times, especially noticeable on slower networks.

The BFF pattern, particularly the transformation bridge or aggregation proxy, decouples client and server concerns, optimizes data mapping, and reduces payload size, leading to faster and more efficient data fetching.

Tanstack Query offers benefits like automatic caching, optimized re-renders, simplified state management, and resilience out of the box, making it ideal for handling asynchronous state in React applications.

Understanding user location and device capabilities helps tailor optimizations to actual user conditions, such as network speed and device performance, ensuring a better user experience and efficient resource usage.

Query criticality involves prioritizing API requests based on their importance to the user interface. Critical requests, like authentication data, are prioritized over less critical ones, ensuring important data is fetched and rendered first.

Implementing timeout strategies ensures that if server-side data fetching takes too long, the process can be aborted, allowing the client to handle data retrieval, thus avoiding delays in rendering the user interface.

Startups are advised to be pragmatic and avoid premature optimization. They should first understand their user base and limiting factors before implementing complex solutions, ensuring resources are used efficiently and effectively.

Faris Aziz
Faris Aziz
28 min
18 Nov, 2025

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Farris emphasizes the need to build resilient applications for real-world usage challenges like high latency and unreliable networks. Creating fast and seamless user experiences is crucial for business success. Core technologies like React and Next, along with Tanstack Query, are discussed. Strategies include optimizing state management, network requests, and data transfer methods for enhanced user experience. The talk also covers data caching, query criticality, prefetching, and handling server retries for robust application performance.

1. Challenges in Building Robust Applications

Short description:

How to optimize user experience in challenging conditions. Farris shares his diverse industry experience, emphasizing the need to build resilient applications. Real-world usage differs significantly from ideal conditions, presenting challenges like high latency and unreliable networks.

How do we optimize user experience in suboptimal conditions? So I got a fantastic introduction, so I'm not going to take too much time. My name is Farris. I've had experience in the connected TV industry, building applications such as Discovery Plus, Eurosport, GCN, worked across FinTech, fitness technology. I love working on open source stuff like Raycast. And I also organize a community called Zurich JS.

As you can see, sometimes I like hanging out with the React Summit Program Committee, as in the photos. So what I want to do to start off is I want to set the stage. And to set the stage, I want to show you this photo. Now I'm from Switzerland, but I'm also from Pakistan. And over there, the traffic isn't the easiest thing to deal with. People buy a bunch of different cars, predominantly Japanese cars. And over there, they're used in every way. They're not intended to be used. So a car will be bought and it's going to not be serviced. It's probably not even get the right fuel in it. And it's essentially an engineer's job to have built this thing to last in conditions that it was not actually built in.

And some of these cars actually go all the way to 620,000 miles. I converted that from kilometers for you just to make things work so you can understand it. But that kind of brings us to the conversation on like we build applications not in sort of the perfect factory at home with a great Wi-Fi connection, so on and so forth. Maybe even Ethernet connection. But our applications aren't actually used in the real world. We started them on localhost and localhost got stable network connection, great bandwidth. You're a single user using the application in an ideal environment. And the real world is very different from that. The real world, you have high latency, unreliable networks, mixed devices between mobile phones of not all the same quality and CPU powers.

2. Building Fast and Seamless User Experiences

Short description:

Developers face challenges in creating seamless user experiences in suboptimal conditions. Building fast and seamless experiences is crucial for business success. Response times within certain limits are vital for user engagement and satisfaction.

So you have throttle CPUs. Then you can get into places where you have partial caches, stale data, flaky APIs. So there's a lot to deal with. And so the problem statement that I want to discover today is what challenges do developers face creating a seamless user experience due to complex data fetching specifically and management? But that question really is, how do we build optimal solutions in suboptimal conditions? And that does not just apply to the real world, but also in startup conditions. You don't have everything handed to you. And sometimes you have to work with just what you have around you.

Now, why do we bother wanting to actually build these experiences that are fast and seamless? Amazon actually did a study in 2006 where around about 100 millisecond increase actually reduced their sales by 1 percent. Back in the day, that was around about 100 million in revenue. And today that would mean over 3 billion. So at scale, this makes a really big difference. But just to get into a little bit more of like what are these golden windows that we want to render our pages in our applications or components? Zero to two seconds is quite ideal. But to dig a little bit more into it, I like to go over the response times of three important limits over here. And there's an excerpt from a chapter on usability engineering.

If you render something in point one seconds, the user feels like the system is reacting instantaneously. It's a really nice experience. If you have something load in one second, it tends to be around about the limit for users flow of thought. Anything longer than a second, if you're clicking through a bunch of buttons and you're going through different workflows, if it takes longer than a second to react, you break your train of thought. And this can be really detrimental to user experience. And if we go all the way to 10 seconds, that's really the limit for keeping the user's attention. And these days with all the TikToks and the six second videos here and there, I am pretty sure that 10 seconds doesn't even hold up. And we already lose our patience and are out about five or six.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Full Stack Components
Remix Conf Europe 2022Remix Conf Europe 2022
37 min
Full Stack Components
Top Content
RemixConf EU discussed full stack components and their benefits, such as marrying the backend and UI in the same file. The talk demonstrated the implementation of a combo box with search functionality using Remix and the Downshift library. It also highlighted the ease of creating resource routes in Remix and the importance of code organization and maintainability in full stack components. The speaker expressed gratitude towards the audience and discussed the future of Remix, including its acquisition by Shopify and the potential for collaboration with Hydrogen.
RedwoodJS: The Full-Stack React App Framework of Your Dreams
React Summit Remote Edition 2021React Summit Remote Edition 2021
43 min
RedwoodJS: The Full-Stack React App Framework of Your Dreams
Top Content
Redwood JS is a full stack React app framework that simplifies development and testing. It uses a directory structure to organize code and provides easy data fetching with cells. Redwood eliminates boilerplate and integrates Jest and Storybook. It supports pre-rendering and provides solutions for authentication and deployment. Redwood is a cross-client framework that allows for building web and mobile applications without duplicating work.
Remix Architecture Patterns
Remix Conf Europe 2022Remix Conf Europe 2022
23 min
Remix Architecture Patterns
Top Content
This Talk introduces the Remix architecture patterns for web applications, with over 50% of participants using Remix professionally. The migration from single page applications to Remix involves step-by-step refactoring and offers flexibility in deployment options. Scalability can be achieved by distributing the database layer and implementing application caching. The backend for frontend pattern simplifies data fetching, and Remix provides real-time capabilities for collaborative features through WebSocket servers and Server-SendEvents.
Thinking Like an Architect
React Summit 2025React Summit 2025
32 min
Thinking Like an Architect
Top ContentPremium
Modern software development shift towards developers involves more complex architecture decisions with trade-offs and long-term consequences. 11 tips learned from diverse projects and roles. Focus on decentralization, avoid technology-first approach, and consider context for great architecture. Understanding the holistic approach to architecture. Linking architecture to culture and structure. Importance of aligning decisions with business needs using techniques like event storming and domain storytelling. Netflix's core domain focuses on content accessibility and tailored user experience. Supporting domains like personalization ensure usability even during downtime. Payment methods, a generic domain, are essential for subscription. Adapting boundaries and architectural characteristics is crucial for evolving businesses. Define evolving core domains and adapt characteristics accordingly. Select key architectural characteristics for system design. Consider different availability needs for various subdomains like core and generic. Latency varies based on functions; strict for finance, flexible for integration. Understand and apply specific characteristics to subdomains for optimal system performance. Understand the need for different approaches in system design. Consider availability requirements for active architecture. Evaluate decisions impacting software design and technology. Modularize workload at code or code-infrastructure level. Consider context in choosing between monoliths and microservices. Adapt system modularity based on context and team structure. Consider modularity based on system requirements. Be pragmatic in architectural decisions. Utilize event-driven architecture in distributed systems. Leverage infrastructure for efficient service stitching and delivery. Adapt to changing system characteristics for scalability and efficiency. Consider cost implications of shifting from event-based to cron job. Design software for evolution, embracing changes and tradeoffs for user-focused systems. Create a sociotechnical system balancing long-term vision and immediate needs with a lean mindset. Embrace an iterative approach to software development, understanding the domain, consumers, and the system. Master communication skills for architects by focusing on communication, inclusion, and documentation. Translate technology reasons into business benefits to effectively communicate with various stakeholders. Change language to match audience, share reasoning effectively. Involve others in decision-making for better understanding and solutions. Master architectural decision records and architecture as code. Utilize written communication for API changes, involve all voices. Sequence diagrams aid team understanding; master architecture as code. Focus on key aspects, prioritize effectively to avoid distractions.
Full-stack JS today: Fastify, GraphQL and React
React Summit 2022React Summit 2022
25 min
Full-stack JS today: Fastify, GraphQL and React
The Talk discusses building a modern full stack application with JavaScript and GraphQL, emphasizing the importance of prioritizing the critical 20% of challenges. It highlights the benefits of building a productive and transparent tech stack with modularity and developer-friendly tools. The use of PostGrey as a relational database and Fastify as a server framework is recommended. The Talk also explores the advantages of using Mercurius and Urql for GraphQL implementation. Additionally, it mentions the use of React, SSR, and Fastify Vite for full-stack SSR and modular components. The Talk concludes by mentioning the advantages of this stack for complex functionality and the possibility of using Fastify in a serverless infrastructure.
Remixing Your Stack in a Monorepo Workspace
Remix Conf Europe 2022Remix Conf Europe 2022
22 min
Remixing Your Stack in a Monorepo Workspace
Let's talk about remixing our stack in a Monorepo workspace, which allows for incremental migration and is suitable for transitioning from a Next.js app to a remix stack. Refactoring may be required for feature-specific and Next.js-coupled components, but the process is simplified because the features have already been moved out. Configuring the Monorepo to reference packages locally and linking them to the Next.js application is necessary. Nx provides benefits like fast refreshing, pre-configured setups, and features like local and remote caching.

Workshops on related topic

Free webinar: Building Full Stack Apps With Cursor
Productivity Conf for Devs and Tech LeadersProductivity Conf for Devs and Tech Leaders
71 min
Free webinar: Building Full Stack Apps With Cursor
Top Content
WorkshopFree
Mike Mikula
Mike Mikula
In this webinar I’ll cover a repeatable process on how to spin up full stack apps in Cursor.  Expect to understand techniques such as using GPT to create product requirements, database schemas, roadmaps and using those in notes to generate checklists to guide app development.  We will dive further in on how to fix hallucinations/ errors that occur, useful prompts to make your app look and feel modern, approaches to get every layer wired up and more!  By the end expect to be able to run your own ai generated full stack app on your machine!
Developing Dynamic Blogs with SvelteKit & Storyblok: A Hands-on Workshop
JSNation 2023JSNation 2023
174 min
Developing Dynamic Blogs with SvelteKit & Storyblok: A Hands-on Workshop
Top Content
WorkshopFree
Alba Silvente Fuentes
Roberto Butti
2 authors
This SvelteKit workshop explores the integration of 3rd party services, such as Storyblok, in a SvelteKit project. Participants will learn how to create a SvelteKit project, leverage Svelte components, and connect to external APIs. The workshop covers important concepts including SSR, CSR, static site generation, and deploying the application using adapters. By the end of the workshop, attendees will have a solid understanding of building SvelteKit applications with API integrations and be prepared for deployment.
Full Stack GraphQL In The Cloud With Neo4j Aura, Next.js, & Vercel
GraphQL Galaxy 2021GraphQL Galaxy 2021
161 min
Full Stack GraphQL In The Cloud With Neo4j Aura, Next.js, & Vercel
Workshop
William Lyon
William Lyon
In this workshop we will build and deploy a full stack GraphQL application using Next.js, Neo4j, and Vercel. Using a knowledge graph of news articles we will first build a GraphQL API using Next.js API routes and the Neo4j GraphQL Library. Next, we focus on the front-end, exploring how to use GraphQL for data fetching with a Next.js application. Lastly, we explore how to add personalization and content recommendation in our GraphQL API to serve relevant articles to our users, then deploy our application to the cloud using Vercel and Neo4j Aura.

Table of contents:
- Next.js overview and getting started with Next.js
- API Routes with Next.js & building a GraphQL API
- Using the Neo4j GraphQL Library
- Working with Apollo Client and GraphQL data fetching in Next.js
- Deploying with Vercel and Neo4j Aura
The Journey From React Frontend Development to Fullstack Development With Next.js
React Advanced 2024React Advanced 2024
143 min
The Journey From React Frontend Development to Fullstack Development With Next.js
Workshop
Eric Burel
Eric Burel
Join us as we journey from React frontend development to fullstack development with Next.js. During this workshop, we'll follow along the official Next.js Learn tutorial with Eric Burel, professional trainer and author of NextPatterns.dev. Together, we'll set up a Next.js website and explore its server-side features to build performant apps.
- Introduction: discovering Next.js and its server-centric philosophy- Crafting a perfectly optimized multi-page website- Making sense of Next.js server-side rendering capabilities- Conclusion: how Next.js empowers you as a React developer
Building full-stack GraphQL applications with Hasura and Vue 3
Vue.js London Live 2021Vue.js London Live 2021
115 min
Building full-stack GraphQL applications with Hasura and Vue 3
Workshop
Gavin Ray
Gavin Ray
The frontend ecosystem moves at a breakneck pace. This workshop is intended to equip participants with an understanding of the state of the Vue 3 + GraphQL ecosystem, exploring that ecosystem – hands on, and through the lens of full-stack application development.

Table of contents
- Participants will use Hasura to build out a realtime GraphQL API backed Postgres. Together we'll walk through consuming it from a frontend and making the front-end reactive, subscribed to data changes.
- Additionally, we will look at commonly-used tools in the Vue GraphQL stack (such as Apollo Client and Urql), discuss some lesser-known alternatives, and touch on problems frequently encountered when starting out.
- Multiple patterns for managing stateful data and their tradeoffs will be outlined during the workshop, and a basic implementation for each pattern discussed will be shown.
Workshop level

NOTE: No prior experience with GraphQL is necessary, but may be helpful to aid understanding. The fundamentals will be covered.