Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pkg/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ export type RequesterConfig = {
* @default "base64"
*/
responseEncoding?: false | "base64";

/**
* Configure the cache behaviour
* @default "no-store"
*/
cache?: CacheSetting;
};

export type HttpClientConfig = {
Expand All @@ -89,7 +95,6 @@ export type HttpClientConfig = {
options?: Options;
retry?: RetryConfig;
agent?: any;
cache?: CacheSetting;
} & RequesterConfig;

export class HttpClient implements Requester {
Expand Down
2 changes: 1 addition & 1 deletion platforms/nodejs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down