Saltar al contenido
Case Studies

Next.js Migration Cuts Page Load Time by 65% for E-Commerce Client

Ruslan Danelian 6 min de lectura
¡Copiado!
Next.js Migration Cuts Page Load Time by 65% for E-Commerce Client

An e-commerce client with a 500-product catalog came to us with a familiar problem: a Create React App frontend that felt sluggish, a Django REST backend that was perfectly fine, and Google Search Console full of red Core Web Vitals warnings. Over eight weeks we migrated the storefront to Next.js 15 incrementally, page by page, with no downtime. Largest Contentful Paint dropped from 4.2 seconds to 1.5 seconds, a 65% improvement, and organic traffic grew 40% within three months.

This article covers the starting point, the migration strategy, and the measured results. The general playbook is in our guide to migrating from Create React App to Next.js; here you get the real numbers.

Key Takeaways
  • The starting point
  • The migration strategy: incremental, page by page
  • The results
  • What we learned

The starting point

The storefront was a client-rendered single-page application. Every visit downloaded a large JavaScript bundle, executed it, then fetched product data from the Django REST API before anything meaningful appeared on screen. On a mid-range phone over 4G, the experience was slow:

MetricBeforeGoogle threshold (good)
Largest Contentful Paint (LCP)4.2 s2.5 s or less
First Input Delay (FID)320 ms100 ms or less
Cumulative Layout Shift (CLS)0.250.1 or less
Lighthouse mobile score4590 or more

All three Core Web Vitals failed. Worse, because product content was rendered by JavaScript, search engines had to run that JavaScript to see product descriptions at all. Indexing was slow and incomplete, and several hundred product pages were stuck in "discovered, currently not indexed".

Why Next.js, and why not rebuild everything

📊 Illustration: infographic summarizing why Next.js, and why not rebuild everything
Visual guide: why Next.js, and why not rebuild everything

The backend was healthy: a Django REST API with solid business logic, authentication, and an admin the staff loved. There was no reason to touch it. The problem was purely the rendering model on the frontend. We evaluated staying with a React SPA and optimizing, moving to Django templates, or moving to Next.js. Our article on React versus Django templates explains the trade-offs; here the client had interactive features (faceted filtering, a persistent cart, live stock indicators) that justified keeping React, and Next.js gave server rendering without abandoning the existing component library.

The general playbook is in our guide to migrating from Create React App to Next.js; here you get the real numbers.

The migration strategy: incremental, page by page

A big-bang rewrite was off the table because the store processed orders every day. We used a reverse proxy to route specific paths to the new Next.js app while everything else continued to hit the old SPA.

  1. Weeks 1-2: foundation. Next.js 15 App Router project, shared design tokens, authentication via the existing Django session and JWT endpoints, and deployment behind the same domain.
  2. Weeks 3-4: product detail pages. The highest-traffic and highest-SEO-value templates moved first, using Incremental Static Regeneration with a 5-minute revalidation window and on-demand revalidation when staff edited a product.
  3. Weeks 5-6: category and search pages. Data-heavy listing pages became Server Components that fetch directly from Django on the server, shipping zero data-fetching JavaScript to the browser. Filters stayed as small client components.
  4. Weeks 7-8: cart, checkout, cleanup. Interactive flows kept client components but benefited from a much lighter shell. We removed the old bundle and redirected legacy routes.

Server Components for data-heavy pages

The biggest win came from React Server Components. A category page previously shipped a data-fetching library, a state manager, and the rendering code for 48 product cards. With Server Components the browser receives finished HTML plus only the JavaScript needed for the filter sidebar. Bundle size on listing pages fell by more than 60%.

60%
Fell by more than

ISR for product pages

With 500+ SKUs that change price and stock occasionally, ISR was ideal. Pages are generated once, served from the edge cache in tens of milliseconds, and refreshed in the background. Visitors always get a static page; the catalog still stays current.

Pro Tip

Visitors always get a static page; the catalog still stays current.

The results

MetricBeforeAfterImprovement
LCP4.2 s1.5 s-65%
FID / interaction delay320 ms80 ms-75%
CLS0.250.05-80%
Lighthouse mobile4594+49 points
JavaScript on product pages~480 KB~120 KB-75%

All three Core Web Vitals moved into the green on field data from the Chrome UX Report within about four weeks of completing the migration, once enough real-user samples accumulated.

Want expert help with this? Let's make it happen.

Get a Free Consultation

Business impact

🎯 Illustration: diagram illustrating Business impact
Visual guide: Business impact
  • Organic traffic up 40% in three months. Faster rendering and server-delivered HTML meant search engines indexed several hundred previously stuck product pages.
  • Bounce rate on mobile dropped from 61% to 44% on product pages.
  • Conversion rate improved modestly, roughly 12% relative, which the client attributed to faster pages and less layout shift near the add-to-cart button.

Speed is rarely the only reason a store underperforms, but it is one of the few factors that affects both rankings and conversion at once. If your backend is Django-based and you want to squeeze more from it before touching the frontend, read our guide to Django site speed optimization.

What we learned

Incremental migration is slower on paper than a rewrite but far safer in practice. We caught two caching bugs on product pages in week four because only a slice of traffic was exposed. Keep the backend API stable during the migration, version it if you must change it, and measure Core Web Vitals with real-user data rather than only lab tests. If you are planning a similar move, our custom web development service includes a performance audit that tells you whether a migration will pay off before you commit.

Related reading: Migrating from Create React App to Next.js | React vs Django Templates: When to Use Which | Django Site Speed Optimization

Is a slow storefront costing you sales? Explore my custom web development service or get in touch for a free consultation.

Frequently Asked Questions

Do I need to rewrite my backend to move to Next.js?

No. In this project the Django REST API was left untouched. Next.js consumed the same endpoints, with a few adjustments to caching headers. Frontend migrations rarely need backend rewrites.

How long does a CRA to Next.js migration take?

For a mid-sized storefront, 6 to 10 weeks is realistic when done incrementally. Smaller marketing sites can move in 2 to 3 weeks. The timeline depends mostly on how many distinct page templates and custom integrations you have.

Will migrating to Next.js improve my SEO?

It can, mainly by making content available as server-rendered HTML and improving Core Web Vitals. In this case, organic traffic rose 40% in three months, but results depend on how much of your content was previously invisible to crawlers.

Ruslan Danelian
Ruslan Danelian

Desarrollador full-stack especializado en Django, automatización con IA y gestión de Google Ads. Construyo plataformas SaaS de producción y aplicaciones web personalizadas para empresas en todo EE.UU.

Lea a continuación

¿Tiene un proyecto en mente?

Cuénteme qué necesita. En un plazo de un día hábil le enviaré un plan con cronograma y precio fijo.

Year-end offer

20% off AI tools & custom CRM

AI chat assistants, DM bots, lead scoring and a CRM built around your business.

Claim 20% off