Skip to content

Commit

Permalink
Merge pull request #104 from defer-run/fix-nextjs-fetch-cache
Browse files Browse the repository at this point in the history
Disable fetch cache
  • Loading branch information
gearnode authored Oct 24, 2023
2 parents c64782b + 3ebd3bf commit e25a922
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-islands-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@defer/client": patch
---

Disable fetch cache
1 change: 1 addition & 0 deletions src/httpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function makeHTTPClient(
...clientOptions,
method,
body,
cache: "no-store",
headers: {
...customHeaderFields,
"Content-type": "application/json",
Expand Down
1 change: 1 addition & 0 deletions tests/httpClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe("makeHTTPClient/3", () => {
expect(fetch).toHaveBeenCalledWith(fakeEndpoint + "/hello", {
method: "GET",
body: null,
cache: "no-store",
headers: expectedHeaderFields,
});
expect(response).toEqual({});
Expand Down

0 comments on commit e25a922

Please sign in to comment.