SSR render HTML trên server để cải thiện first content, SEO và perceived performance.
Cấu hình hydration phía client thường nằm ở bootstrap:
bootstrapApplication(AppComponent, {
providers: [provideClientHydration(withEventReplay())],
})Hydration tái sử dụng HTML đã render thay vì vẽ lại toàn bộ trên client.
Cần đảm bảo server/client render deterministic; code dùng window, random, timezone hoặc DOM measurement phải chạy đúng browser-only guard.
SSR renders HTML on the server to improve first content, SEO and perceived performance.
Client hydration is usually configured at bootstrap:
bootstrapApplication(AppComponent, {
providers: [provideClientHydration(withEventReplay())],
})Hydration reuses server-rendered HTML instead of redrawing everything on the client.
Ensure server/client rendering is deterministic; code using window, randomness, time zones or DOM measurement must run behind browser-only guards.