Use Angular’s HTTP transfer cache through `withHttpTransferCacheOptions()` as a feature of `provideClientHydration()`. The server performs the request, serializes the response into the rendered page, and the browser reuses that response during hydration instead of immediately issuing the same GET again: ```ts import { provideHttpClient } from '@angular/common/http'; import { provideClientHydration, withHttpTransferCacheOptions, } from '@angular/platform-browser'; export const appConfig = { pr...
Scanned 9/5/2026
Install to Claude Code
npx -y skills add HoangNguyen0403/agent-skills-standard --skill angular-ssr --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Angular Ssr?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-angular-ssr-0adee388)More formats (shields.io, HTML) on the badges page.
Use Angular’s HTTP transfer cache through `withHttpTransferCacheOptions()` as a feature of `provideClientHydration()`. The server performs the request, serializes the response into the rendered page, and the browser reuses that response during hydration instead of immediately issuing the same GET again:
```ts
import { provideHttpClient } from '@angular/common/http';
import {
provideClientHydration,
withHttpTransferCacheOptions,
} from '@angular/platform-browser';
export const appConfig = {
providers: [
provideHttpClient(),
provideClientHydration(
withHttpTransferCacheOptions({
includePostRequests: false,
}),
),
],
};
```
Leave POST caching disabled unless the operation is explicitly safe and idempotent. The cache is most appropriate for repeatable GET requests, and the request URL/parameters must identify the data correctly; otherwise one user or query can receive another request’s transferred result. Do not put private or user-sensitive data into HTML that is sent to the browser.
For data that is not an `HttpClient` response, or when the cache key/lifetime needs manual control, use `TransferState`:
```ts
const key = makeStateKey<Product>(`product:${id}`);
if (this.transferState.hasKey(key)) {
return of(this.transferState.get(key, null));
}
return this.http.get<Product>(`/api/products/${id}`).pipe(
tap((product) => {
if (isPlatformServer(this.platformId)) {
this.transferState.set(key, product);
}
}),
);
```
Use a key that includes every input affecting the result, set the value on the server only, and read it before making the client request. This prevents the server-rendered value and the hydrated client from both fetching the same resource.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!