mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
docs: add documentation for HTTP_TRANSFER_CACHE_ORIGIN_MAP
(cherry picked from commit 7e1e396a00)
This commit is contained in:
parent
5b911d6025
commit
56418b108e
2 changed files with 3 additions and 1 deletions
|
|
@ -551,6 +551,8 @@ To disable caching for an individual request, you can specify the [`transferCach
|
|||
httpClient.get('/api/sensitive-data', { transferCache: false });
|
||||
```
|
||||
|
||||
NOTE: If your application uses different HTTP origins to make API calls on the server and on the client, the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token allows you to establish a mapping between those origins, so that `HttpTransferCache` feature can recognize those requests as the same ones and reuse the data cached on the server during hydration on the client.
|
||||
|
||||
## Configuring a server
|
||||
|
||||
### Node.js
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ export type HttpTransferCacheOptions = {
|
|||
* between those origins, so that `HttpTransferCache` feature can recognize those requests as the same
|
||||
* ones and reuse the data cached on the server during hydration on the client.
|
||||
*
|
||||
* **Important note**: the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token should *only* be provided in
|
||||
* IMPORTANT: The `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token should *only* be provided in
|
||||
* the *server* code of your application (typically in the `app.server.config.ts` script). Angular throws an
|
||||
* error if it detects that the token is defined while running on the client.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue