Cloudflare DevelopersCD
Cloudflare Developers2y ago
7 replies
jdruwe

next-on-pages suspense cache KV not being populated

Hi all!

We've added a KV binding to support the persistance of the next.js suspense cache as described at: https://github.com/cloudflare/next-on-pages/blob/502b4cd03f1d215972b4c9916e608ada28dba067/packages/next-on-pages/docs/caching.md#workers-kv:

[[kv_namespaces]]
binding = "__NEXT_ON_PAGES__KV_SUSPENSE_CACHE"
id = "OUR_ID_HERE"


We are using the sanity CMS and don't see any response being cache, which is odd. So I tried calling thw following simple API:

const request = await fetch('https://httpbin.org/get', {
  cache: 'force-cache',
});


And also for this request it seems like nothing was cached as my KV folder is empty (see screenshot). Am I doing something wrong?

version:
- next: 14.2.3
- next-on-pages: 1.12.1
GitHub
CLI to build and develop Next.js apps for Cloudflare Pages - cloudflare/next-on-pages
next-on-pages/packages/next-on-pages/docs/caching.md at 502b4cd03f1...
Was this page helpful?