Skip to content
PRS India

Kesari & Co.

A headless D2C replatform that took LCP from 4.9s to 1.6s

Shopify to headless Next.js, a promotion engine that marketers can write rules for, live stock with a reservation ledger, and an ONDC adapter kept on purpose away from the main D2C buying path.

Client
Kesari & Co.
Industry
D2C Retail & Beauty
Location
Mumbai, India
Duration
16 weeks
Published
Mar 2023
Updated
Oct 2026

1.6s

Largest Contentful Paint on mid-tier Android, down from 4.9s

34% lift

Higher mobile conversion rate, same traffic mix

80% smaller

Less JavaScript shipped before first paint

0

Oversells across four flash drops post-launch

01

The challenge

Kesari & Co. sells ayurvedic skincare direct to consumers — 2,300 SKUs once you multiply shade by size, ₹40 crore of annual GMV, and 74% of their traffic arriving on a mid-range Android phone over a patchy 4G connection. They had outgrown their Shopify theme in every way at once.

The storefront was the bottleneck

Largest Contentful Paint on a Redmi-class device over throttled 4G was 4.9 seconds. Core Web Vitals were failing on every template that mattered. The cause was clear: fourteen Shopify apps each added their own scripts, and the storefront was sending ~900 KB of JavaScript before a single product image appeared. Every app had been added to solve a real problem, and together they were the problem.

Three constraints an off-the-shelf theme could not satisfy

  • Their promotion logic had outgrown the platform. They wanted build-your-own-routine bundles with tiered discounts, subscribe-and-save, and a loyalty tier multiplier — as rules the marketing team could write themselves. The discount tools in their theme could not do this. So they ran promotions by making and deleting variants by hand. In one Diwali campaign this created a bundle that could be bought for less than the cost of one of its parts.
  • Inventory truth lived somewhere else. Stock was copied from their 3PL's warehouse system every six hours. During a flash drop, six hours is far too long. They sold 400 units more than they had of a top SKU on one launch and spent three weeks apologising.
  • ONDC was coming. They wanted to list on the Open Network for Digital Commerce without adding a second, different catalogue to the side of the business. They also did not want network traffic anywhere near the buying path that pays the bills.

The request they came with was "rebuild our store". The plan we agreed on was narrower and more useful: take the storefront off the platform's page-making path, move promotions into a rules engine, make stock live, and make ONDC an adapter, not a copy.

02

What we built

Headless — but we kept Shopify

The biggest decision on this project was the one we refused. We did not move them onto a custom commerce core. Shopify's checkout is PCI-audited, proven against fraud, and handles Indian payment methods and tax edge cases that would have quietly used up six months of our time and given a worse result. Owning the checkout would have given us control we did not need and a risk we did not want.

So Shopify stays as the commerce base — main catalogue, checkout, payments, orders. Everything the customer sees before the checkout is a Next.js storefront talking to the Storefront API. Pages are built ahead of time and refreshed when product and stock webhooks fire. Product pages are served from the edge as HTML. A catalogue that changes weekly should not be built again for every visit.

Cutting 900 KB down to 180 KB

We removed the fourteen apps. Three of them mattered — reviews, subscriptions, analytics — and we rebuilt those as our own features drawn on the server. The rest were replaced by things the platform already does. First-load JS went from ~900 KB to 180 KB. Images moved to an AVIF/WebP pipeline with the right size for each screen width, because on a 4G Android phone the image pipeline is the speed plan.

A promotion engine the marketing team can actually use

Bundle and tier rules are written in a Laravel admin — a small, versioned rules DSL with saved versions and a preview mode that shows the final price before publishing. Rules turn into Shopify Functions that run inside the checkout. So the discount the customer sees in the cart is worked out by the same code that works out the discount they pay. Two sources of pricing truth is how you end up selling a bundle below cost.

Real-time inventory and a reservation ledger

The six-hour copy job is gone. The warehouse system now sends stock changes by webhook. On top of that sits a reservation ledger in Redis. Adding to cart during a flash drop puts a timed hold on available stock, and the hold ends if checkout is abandoned. This is the difference between "we think we have stock" and "we have kept your unit for you".

ONDC as an adapter, off the critical path

The Beckn protocol endpoints (search / select / init / confirm / status) live in a separate Laravel service that maps network calls onto the same Shopify catalogue and order APIs. It is kept apart on purpose. The client cannot control how much traffic the network sends, and a burst of network search calls must never slow down the D2C buying path. One catalogue, two front doors, and a problem at one door does not reach the other.

03

The outcome

We switched over in two stages. Collection and product pages came first, on 20% of traffic for eleven days, then the rest. There was no single risky weekend switch.

Speed turned directly into revenue

  • LCP on a mid-tier Android over throttled 4G: 4.9s → 1.6s. All Core Web Vitals green, on mobile, on the pages that carry the traffic — not just on the homepage that everyone tests.
  • Mobile conversion rate rose 34% over the eight weeks after the full switch, measured against the same mix of traffic. Nothing else changed in that time: no new ads, no new discounts, no new way of bringing in customers. This is the clearest proof we have ever had of the value of a fast storefront.
  • 80% less JavaScript sent before first paint. The number that mattered more to them: their marketing team can no longer add 60 KB of blocking script by mistake by installing an app, because there are no apps.
  • Zero oversells across the next four flash drops, including one that sold 3,100 units in nine minutes. The reservation ledger held.

What changed for the business

Promotions that used to take a developer and two days now take a marketer and twenty minutes. The preview mode has caught three pricing mistakes before they reached a customer, including one that would have repeated the Diwali below-cost bundle almost exactly.

They went live on ONDC four months later. That was two weeks of work, not a rebuild, because the adapter was already there, speaking to the same catalogue. That is the whole reason for building it as an adapter, and it is worth more than any speed number on this page.

Under the hood

How it's built.

Technology

  • Next.js
  • React
  • TypeScript
  • Shopify Storefront API
  • Shopify Functions
  • Laravel
  • Redis
  • MySQL 8
  • Beckn / ONDC Protocol
  • Cloudflare
  • Vercel
  • AVIF / WebP pipeline

Services used

  • Ecommerce Development
  • Web Development
  • Performance Engineering
  • API Integration
  • UI/UX Design

Every agency we spoke to wanted to rebuild our checkout. PRS was the only one that told us not to — and then explained, in detail, why. They talked us out of the most expensive thing on the table.

Ananya Bhatt Founder & CEO, Kesari & Co.

Same problem?

Let's build something that ships.