From 91d425f69c6ebccaaf627a7e4996617f62cea162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Delaporte?= <12201973+fredericDelaporte@users.noreply.github.com> Date: Thu, 26 Jun 2025 17:20:50 +0200 Subject: [PATCH 1/2] Clarify the type option of the cache interceptor People not knowing well the HTTP cache semantic may misleadingly believe that `private` is a safer choice than `shared`. Add a bit of guidance about the effect of private. --- docs/docs/api/Dispatcher.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/api/Dispatcher.md b/docs/docs/api/Dispatcher.md index 6def7872dbf..1dc4eb388c0 100644 --- a/docs/docs/api/Dispatcher.md +++ b/docs/docs/api/Dispatcher.md @@ -1104,7 +1104,7 @@ The `cache` interceptor implements client-side response caching as described in - `store` - The [`CacheStore`](/docs/docs/api/CacheStore.md) to store and retrieve responses from. Default is [`MemoryCacheStore`](/docs/docs/api/CacheStore.md#memorycachestore). - `methods` - The [**safe** HTTP methods](https://www.rfc-editor.org/rfc/rfc9110#section-9.2.1) to cache the response of. - `cacheByDefault` - The default expiration time to cache responses by if they don't have an explicit expiration. If this isn't present, responses without explicit expiration will not be cached. Default `undefined`. -- `type` - The type of cache for Undici to act as. Can be `shared` or `private`. Default `shared`. +- `type` - The type of cache for Undici to act as. Can be `shared` or `private`. Default `shared`. `private` means privately cacheable responses will be cached and potentially shared with other users of your application. ## Instance Events From 2074989aac2142aea94e3ffbf39955f15204d55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Delaporte?= Date: Fri, 27 Jun 2025 11:42:25 +0200 Subject: [PATCH 2/2] Add link to type of cache explanation --- docs/docs/api/Dispatcher.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/api/Dispatcher.md b/docs/docs/api/Dispatcher.md index 1dc4eb388c0..027566741ac 100644 --- a/docs/docs/api/Dispatcher.md +++ b/docs/docs/api/Dispatcher.md @@ -1104,7 +1104,7 @@ The `cache` interceptor implements client-side response caching as described in - `store` - The [`CacheStore`](/docs/docs/api/CacheStore.md) to store and retrieve responses from. Default is [`MemoryCacheStore`](/docs/docs/api/CacheStore.md#memorycachestore). - `methods` - The [**safe** HTTP methods](https://www.rfc-editor.org/rfc/rfc9110#section-9.2.1) to cache the response of. - `cacheByDefault` - The default expiration time to cache responses by if they don't have an explicit expiration. If this isn't present, responses without explicit expiration will not be cached. Default `undefined`. -- `type` - The type of cache for Undici to act as. Can be `shared` or `private`. Default `shared`. `private` means privately cacheable responses will be cached and potentially shared with other users of your application. +- `type` - The [type of cache](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching#types_of_caches) for Undici to act as. Can be `shared` or `private`. Default `shared`. `private` implies privately cacheable responses will be cached and potentially shared with other users of your application. ## Instance Events