Skip to content

perf(marketing): client-side render below-the-fold homepage sections#2948

Merged
TorstenDittmann merged 3 commits intomainfrom
fix/marketing-ssr-performance
Apr 30, 2026
Merged

perf(marketing): client-side render below-the-fold homepage sections#2948
TorstenDittmann merged 3 commits intomainfrom
fix/marketing-ssr-performance

Conversation

@TorstenDittmann
Copy link
Copy Markdown
Contributor

Summary

  • Client-side renders all homepage sections below LogoList (Bento, Pullquote, Ai, CaseStudies, Features, Map, Scale, Pricing) to eliminate ~580ms of SSR CPU time per request.
  • Adds a single 100vh SSR placeholder to keep the footer below the fold on initial paint.
  • Keeps Hero, Platforms, LogoList, FooterNav, and MainFooter SSR'd for fast first paint and SEO coverage.
  • Removes an unused browser import from logo-list.svelte.

Expected impact

Metric Before After
SSR time (warm) ~585 ms ~5 ms
Speedup ~100×

Notes

  • prerender = false is intentionally preserved so Statsig hero experiments continue to be evaluated server-side.
  • This is a band-aid fix; the long-term solution is prerendering with client-side experiment assignment and designed skeleton states.

Wrap all components below LogoList (Bento, Pullquote, Ai, CaseStudies,
Features, Map, Scale, Pricing) in {#if browser} to avoid expensive SSR
rendering on every request. Adds a single 100vh placeholder to keep the
footer below the fold on the initial SSR paint.

- Hero, Platforms, LogoList remain SSR'd for fast first paint
- FooterNav and MainFooter remain SSR'd for SEO/crawler coverage
- Removes unused browser import from logo-list.svelte

Reduces warm SSR time from ~585ms to ~5ms.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 30, 2026

Greptile Summary

This PR defers eight below-the-fold homepage sections to client-side rendering via {#if browser}, replacing them with a 100vh placeholder during SSR. The stated ~100× SSR speedup is credible and the implementation is straightforward. The one follow-up worth considering is switching to dynamic import() for the deferred components so their module code is also split out of the initial JS bundle.

Confidence Score: 5/5

Safe to merge — no correctness, security, or data issues introduced.

Changes are minimal and intentional: a standard {#if browser} CSR gate and removal of an unused import. No P0 or P1 findings; only a P2 bundle-size suggestion.

No files require special attention.

Important Files Changed

Filename Overview
src/routes/(marketing)/+page.svelte Wraps below-the-fold sections in {#if browser} for CSR-only rendering with an h-screen SSR placeholder; logic is correct and intentional.
src/routes/(marketing)/(components)/logo-list.svelte Removes an unused browser import — clean housekeeping, no logic changes.

Reviews (2): Last reviewed commit: "refactor(marketing): use tailwind h-scre..." | Re-trigger Greptile

Comment thread src/routes/(marketing)/+page.svelte Outdated
Comment thread src/routes/(marketing)/+page.svelte
Copy link
Copy Markdown
Contributor Author

@TorstenDittmann TorstenDittmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@greptile-apps Noted on the SEO concern, but this is an intentional trade-off for this specific page. The marketing homepage relies on server-side Statsig experiment evaluation for the hero section, which requires prerender = false. The SEO-critical content (hero copy, platform descriptions, footer links) remains SSR'd. The below-the-fold sections (features, pricing, etc.) are not primary landing traffic drivers — users land on dedicated /products/* and /pricing pages for that content. This is documented as a band-aid fix until we can prerender with client-side experiment assignment.

@TorstenDittmann TorstenDittmann merged commit 63fbd8e into main Apr 30, 2026
6 checks passed
@TorstenDittmann TorstenDittmann deleted the fix/marketing-ssr-performance branch April 30, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants