Skip to content

Commit a2d611c

Browse files
re-enable fetch cache test (by adding KV caching to the app-router app)
1 parent 880403b commit a2d611c

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

examples/e2e/app-router/e2e/ssr.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ test.skip("Server Side Render and loading.tsx", async ({ page }) => {
2828
}
2929
});
3030

31-
// Fetch caching doesn't currently work: https://github.com/opennextjs/opennextjs-cloudflare/issues/311
32-
test.skip("Fetch cache properly cached", async ({ page }) => {
31+
test("Fetch cache properly cached", async ({ page }) => {
3332
await page.goto("/ssr");
3433
const originalDate = await page.getByText("Cached fetch:").textContent();
3534
await page.waitForTimeout(2000);

examples/e2e/app-router/open-next.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type { OpenNextConfig } from "@opennextjs/aws/types/open-next.js";
2+
import cache from "@opennextjs/cloudflare/kvCache";
23

34
const config: OpenNextConfig = {
45
default: {
56
override: {
67
wrapper: "cloudflare-node",
78
converter: "edge",
8-
// Unused implementation
9-
incrementalCache: "dummy",
9+
incrementalCache: async () => cache,
1010
tagCache: "dummy",
1111
queue: "dummy",
1212
},

examples/e2e/app-router/wrangler.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,11 @@
77
"assets": {
88
"directory": ".open-next/assets",
99
"binding": "ASSETS"
10-
}
10+
},
11+
"kv_namespaces": [
12+
{
13+
"binding": "NEXT_CACHE_WORKERS_KV",
14+
"id": "<BINDING_ID>"
15+
}
16+
]
1117
}

0 commit comments

Comments
 (0)