Web DevelopmentPharmaExpo
Storefront Rebuild and Page Builder
Marketing needed to launch campaign pages without filing a ticket. Building that meant first fixing why the site could not serve composable pages: every route was server-rendered on demand, so each visit cost server work whether the content had changed or not.
01
The problem
Marketing wanted to launch campaign pages themselves. Every page was a developer ticket, which put a deploy between an idea and a live page and made the dev team the bottleneck on the marketing calendar. Underneath that was a second problem nobody had framed as one: every route was server-rendered on demand, so each visit cost server work regardless of whether the content had changed since the last one. PageSpeed sat at 44. A page builder bolted onto that would have made the problem worse, because composable pages mean more routes, and more routes rendered per request means more load.
02
The approach
Treat them as one piece of work. The CMS-driven routes moved from the Pages Router to the App Router, which made the server/client boundary something I could place per block rather than per page. Then the block set was designed around that boundary: presentational blocks render on the server and ship no JavaScript, blocks that hold state or read per-request data run on the client, and most blocks fall on the server side. The same blocks serve two kinds of page — freestyle ones someone composes by hand, and templates where the shape is fixed and the backend supplies the data — with the editor giving each its own tab and backend data taking precedence inside a template. Underneath sits a set of design tokens, so any arrangement of blocks still looks like the product. Pages build statically wherever the content allows, with on-demand revalidation so an edit appears immediately. A media manager converts uploads to WebP once, on upload, which matters because images are the heaviest thing on a marketing page. The whole thing shipped page by page on a live store.
Overview
- 44 → 90+
- PageSpeed on rebuilt pages
- 0
- developer involvement in a campaign launch
- 0
- minutes of downtime, rebuilt on a live store
03
Key decisions
Rebuilding the rendering architecture as part of the builder
over Adding a page builder to the site as it was
The ask was a page builder, and it would have been possible to deliver one without touching how the site rendered. But composable pages mean more routes, and every route was being rendered on demand, so shipping the feature as asked would have multiplied the exact cost that was already holding the site at a PageSpeed of 44. Doing the architecture first was not in the brief; it was the difference between the feature working and the feature making things worse.
Placing the server/client boundary per block
over Per page, or defaulting everything to the client
A page assembled from blocks has no single correct rendering mode, because the blocks differ. Presentational blocks have nothing to be interactive about, so they render on the server and ship no JavaScript. Blocks that hold state or depend on per-request data have to be client components. Deciding this once per block, rather than per page, meant a marketing page built from mostly static blocks is mostly static no matter who assembled it or in what order.
Static pages with on-demand revalidation
over Server rendering every request
Campaign content changes when marketing changes it, not on every visit, so rendering per request was paying a cost for freshness the content did not need. Building statically and revalidating on demand inverts that: the page is a file until an edit invalidates it, and the edit still shows up immediately. That is the property that made the builder usable — if changes only appeared on the next deploy, marketing would still be waiting on the dev team.
One block set serving both freestyle pages and templates
over Separate blocks, or a separate renderer, for templated pages
Two kinds of page needed building: one-off campaign pages someone composes by hand, and repeatable pages where the shape is fixed and only the data changes. The obvious route is two systems, which means every block eventually exists twice and the two copies drift. Instead the blocks that can carry templated data take their content from the CMS on a freestyle page and from the backend inside a template, with the backend winning when both could apply. One rule, applied per block, and the editor gets separate tabs for the two modes so it is always clear which kind of page is being built.
Building the builder in-house
over A hosted page builder or an off-the-shelf library
The block set had to match the storefront's own components, and the rendering decisions above had to hold inside the builder rather than being whatever the vendor's renderer did. A third-party builder would have meant either accepting its output or fighting it. Building it meant the blocks are the site's blocks, and the server/client split survives composition.
Design tokens underneath the block set
over Styling each block on its own terms
Once someone outside the team can arrange blocks in any order, every block has to look like it belongs next to every other one. Styling them individually means that holds until the first combination nobody tried. Building them on a shared set of tokens for colour, spacing and type means a page still looks like the product whatever order it was assembled in, and a change to the system reaches every page rather than the ones someone remembered to update.
Converting uploads to WebP once, on upload
over Converting on request, or leaving originals as they are
Marketing uploads whatever they have, which is usually a large JPG or PNG straight from a camera or a designer. Converting on upload means the heavy work happens once, at the moment someone is already waiting for an upload to finish, rather than on a visitor's request. Everything served from then on is the converted file. Images are usually the largest thing on a marketing page, so this is a meaningful part of why the PageSpeed numbers moved.
A familiar block editor with drag and drop
over A bespoke interface tuned to how the pages are structured
The people using it already knew WordPress. Matching that model — blocks, drag and drop, a custom HTML block when nothing else fits — meant the handover was mostly a conversation rather than training. An interface that is more precise but unfamiliar gets used once and then becomes a ticket again.
Shipping page by page on the live store
over A cutover once the rebuild was finished
The store takes orders continuously, so there was no window where taking it down was acceptable. Migrating route by route meant each page could be verified in production against real traffic before the next one moved, and a problem affected one page rather than the whole site.
04
What I built
Router migration
Next.js Pages Router → App Router
Made the server/client boundary something that could be decided per block rather than per page.
Block set
React Server Components · React · TypeScript
Editable blocks with a deliberate server or client placement each, so composition cannot accidentally make a page expensive.
Page builder
In-house · drag and drop
Marketing assembles and launches a campaign page without a developer or a deploy.
Custom HTML block
Block set escape hatch
Covers the cases the block set does not, so an unusual campaign does not become a ticket.
Templates
Backend-driven data · shared block set
Repeatable pages built from data rather than composed by hand, using the same blocks as the freestyle editor. In a template, backend data takes precedence over CMS content.
Design tokens
Colour · spacing · type scale
Blocks drawn from one token set, so any arrangement still looks like the product and a system change reaches every page.
Media manager
WebP conversion on upload
Uploads are converted once and served converted, which takes the largest thing on a marketing page off the critical path.
Rendering strategy
Static generation · on-demand revalidation
Pages are files rather than per-request work, and an edit still appears immediately.
Performance
Core Web Vitals
PageSpeed 44 to over 90 on rebuilt pages. Live sits at 55 to 65 with the marketing trackers loaded, which is the real ceiling.
Rollout
Incremental migration
Shipped page by page against live traffic, with the store taking orders throughout.
05
The outcome
Marketing composes and launches campaign pages with no developer in the loop. PageSpeed went from 44 to over 90 on the rebuilt pages; live scores sit around 55 to 65, because the marketing trackers cost roughly 30 points and no amount of rendering work gets past that while they load. Establishing that ceiling took measuring rather than assuming, and it is a more useful number to have than an aspiration.
Stack
- Next.js
- App Router
- React Server Components
- React
- TypeScript
- Tailwind CSS
- Incremental Static Regeneration
- On-Demand Revalidation
- CMS Integration
- Design Tokens
- Design System
- WebP
- Image Optimization
- Core Web Vitals





