Trung BìnhAngular iconAngular

Angular SSR và hydration giải quyết vấn đề gì?

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:

typescript
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.

Xem toàn bộ Angular cùng filter theo level & chủ đề con.

Mở danh sách Angular