How we made a Next.js EdTech platform 40% faster
The caching, code-splitting and session changes that cut load times by 40% for 5,000+ learners, and what they did for engagement.
When I joined the Cravta team as frontend lead, the platform had a problem every growing product eventually hits: it was getting slower as it got more successful. Dashboards for students, instructors and admins were loading heavy bundles, refetching the same data on every navigation and waiting on session lookups.
Here is what we changed, in the order that delivered the most value.
1. Treat server state as a cache, not a fetch
Most of the slowness was the same data fetched over and over. We moved server state to TanStack Query with sensible staleTime values per resource. Course catalogues barely change, so they stay fresh for minutes. Progress data changes often, so it refetches in the background.
The result: navigating between dashboard tabs became almost instant, because the data was already there.
2. Ship less JavaScript on first load
We audited the bundle and found rich-text editors, charting libraries and admin-only tooling shipped to every student. With route-level code-splitting and lazy loading, each role now downloads only what it uses.
3. Make sessions cheap
Session validation was hitting the database on every request. Moving hot session data to Redis removed that round trip from the critical path.
4. Measure what users feel
We tracked LCP and TTI before and after every change, so each optimisation had to prove itself in numbers rather than intuition.
The outcome
- 40% faster page loads across the platform
- Better Core Web Vitals, which helps SEO as well as users
- A codebase where performance is a habit, not a fire drill
If your product is slowing down as it grows, these four steps are usually where I start. Book a free performance review and I'll show you where your quickest wins are.