diff --git a/pkg/http.ts b/pkg/http.ts index 79905366..e6fbc38b 100644 --- a/pkg/http.ts +++ b/pkg/http.ts @@ -81,6 +81,12 @@ export type RequesterConfig = { * @default "base64" */ responseEncoding?: false | "base64"; + + /** + * Configure the cache behaviour + * @default "no-store" + */ + cache?: CacheSetting; }; export type HttpClientConfig = { @@ -89,7 +95,6 @@ export type HttpClientConfig = { options?: Options; retry?: RetryConfig; agent?: any; - cache?: CacheSetting; } & RequesterConfig; export class HttpClient implements Requester { diff --git a/platforms/nodejs.ts b/platforms/nodejs.ts index e6e73a4d..6ba97943 100644 --- a/platforms/nodejs.ts +++ b/platforms/nodejs.ts @@ -121,7 +121,7 @@ export class Redis extends core.Redis { headers: { authorization: `Bearer ${configOrRequester.token}` }, agent: configOrRequester.agent, responseEncoding: configOrRequester.responseEncoding, - cache: "no-store", + cache: configOrRequester.cache || "no-store", }); super(client, {