Multi-brand platform
I led the frontend migration that cut page weight and LCP by 75 to 90 percent on a platform serving several brands.
Role Senior frontend developer Year 2025-2026
Static base page + dynamic islands
page.tsx · export const dynamic = "force-static"
#Context
I led the move to the App Router and the move of pages to static rendering on my own on a regulated online gambling platform serving multiple brands. At the end I prepared an SEO foundation that also covers AI crawlers. Before that I worked with the team on a new look for these brands. The brands shared one codebase in a Next.js monorepo. Each ran on its own domains and under the rules of a different European country.
Most of this work is covered by an NDA, so I describe the architecture, patterns and trade-offs, without brand, end-client or vendor names.
#What I delivered
- Migration to the App Router. All apps moved to a newer Next.js with the App Router. I organised the functional areas into route groups.
- Static pages with dynamic islands. It is a pattern borrowed from Astro. The base page is static, and small client-side islands run only where the user’s session matters. I started with a prototype of one page and then rolled the pattern out to further groups of pages across all brands.
- Content from the CMS. I prepared content types that let editors change content, metadata and search engine directives without a new deploy.
- SEO and structured data. Brands and help pages got JSON-LD. The sitemap is built from the list of pages in the CMS. Robot rules, including those for AI crawlers, are set separately for each page.
- Lighter pages. CSS-in-JS styles go into separate files that the CDN caches. Visitors who are not signed in get a smaller provider tree.
Real impact of the changes
- -79%
Page weight (mobile, one of the static screens)
- -75%
Page weight (desktop, product list view)
- -77%
LCP (mobile, static screen)
- -88%
LCP (mobile, homepage)
- -90%
TTFB (mobile, product list view)
- -73%
TBT (mobile, product list view)
Where these numbers come from
The numbers come from Lighthouse audits I ran myself, comparing production before the changes with the branch after them on a test environment. I treat them as directional, because a single run varies. I give only the relative change, because the absolute values are client data covered by the NDA.
#Challenges
Many brands in one codebase
The other brands use the base brand’s code through path aliases, so one change in shared code touches all of them at once. I had to work out what belongs in shared packages and what has to stay separate for a brand. A shared change can also quietly affect a language version or one country’s rules in another brand. That is why the E2E tests ran separately for each brand.
A gradual move to static rendering
A multi-brand app that is live in production cannot be switched in one move. First I checked the dynamic islands pattern on a prototype of one page. Then I moved pages in groups. I started with static information pages, the homepage came next, and the heavier signed-in areas came last. Every step could be checked and rolled back. I rolled back one optimisation and investigated it again before it returned to production.
Interface states required by the regulator
Operations the regulator requires are more than an ordinary form. An action may need a password confirmation. Then a mandated waiting period starts, in which the change is “pending” and not yet in effect. The rules also differ between countries. Modelling those intermediate states correctly and showing them clearly to the user was the hardest part of the interface.
#Takeaways
- In a multi-brand monorepo shared patterns give the most, because they let the brands develop together.
- Static pages pay off when you are honest about which parts are truly dynamic and limit them to a few islands.
- E2E tests run separately for each brand are necessary, because a change in shared code can quietly affect another brand.