Lesson 4 of 9 · 25m
SSR, SSG, CSR, and Rendering for Search
What crawlers can execute, what they cannot forgive, and how to choose server rendering, static generation, or client rendering by content type.
A few years ago the standard answer was "Google renders JavaScript, so CSR is fine now." It is technically true and practically incomplete. Google can render JavaScript, but rendering is a second-stage queue, constrained by resources and delayed relative to initial crawling. If your primary content, links, title, or canonical only appear after hydration, you have inserted latency and failure modes into the most machine-critical part of the page.
The rendering decision is content-dependent
| Strategy | Best for | SEO risk |
|---|---|---|
| SSG | stable marketing pages, docs, blog posts | stale content unless rebuilt or revalidated |
| SSR | personalized or frequently changing pages | server cost, caching complexity |
| ISR | large catalogs that change unevenly | first-hit latency, stale windows |
| CSR | authenticated apps, dashboards | delayed indexing, fragile discovery |
The mistake is picking one strategy ideologically. A course catalog can be statically generated, a lesson page can be statically generated with incremental revalidation, and the authenticated progress dashboard can be client rendered because it should not be indexed anyway.
View-source is the baseline test
curl -s https://sudosecurity.org/learn | grep -o '<title>[^<]*</title>'Fetch the HTML like a crawler, before JavaScript runs. The important things should already be present:
- canonical link,
- title and meta description,
- primary heading and body copy,
- crawlable anchor hrefs,
- structured data if it represents visible content,
- correct status code.
Hydration may enhance the experience. It should not be required to understand what the page is.
The client-rendered failure mode
function Lesson() {
const [lesson, setLesson] = useState(null);
useEffect(() => {
fetch(`/api/lessons/${id}`).then(r => r.json()).then(setLesson);
}, [id]);
if (!lesson) return <Spinner />;
return <article>{lesson.body}</article>;
}The initial HTML is a spinner. If rendering is delayed, blocked, or the API request fails, the crawler sees nothing. Worse, internal links to other lessons may also be absent from the raw HTML, weakening discovery. Even when rendering succeeds, you have made indexing depend on network waterfalls and JavaScript execution.
Practical implementation rules
Use SSR or SSG for public content whose value depends on search discovery. Use CSR behind authentication or for pages explicitly marked noindex. Cache SSR output at the page or fragment level where possible, and make the caching key include only variables that truly alter public content. Personalization should usually happen after the cacheable HTML shell, not prevent caching entirely.
For framework teams, this is often less about rewriting everything and more about moving three things server-side: metadata, primary content, and links. Interactive widgets can hydrate afterward.
Field notes
- Rendering service errors can create intermittent indexing loss that looks random in Search Console; check edge logs and render traces.
- Avoid user-agent cloaking. Serve the same content to users and crawlers, even if the delivery mechanism differs by capability.
- Client-side redirects are slower and weaker than server redirects; use real
301/308responses whenever possible. - If content is behind a click but visible in the initial HTML, it is generally discoverable. If it requires an API call after interaction, it is not.
Was this lesson helpful?