cloudflare-docs icon indicating copy to clipboard operation
cloudflare-docs copied to clipboard

Add documentation about caching options

Open onepixelsolid opened this issue 1 year ago • 1 comments

Existing documentation URL(s)

  • https://developers.cloudflare.com/pages/framework-guides/nextjs/deploy-a-nextjs-site/

What changes are you suggesting?

It's currently not clear what options you have for Nextjs caching with Cloudflare. Specifically how you can hook up a reliable distributed cache setup by adding Workers KV as your cache binding. This to me is critical coming from Vercel where caching performs as well as Workers KV out-of-the-box.

The suggestion is to add a clear section on this page outlining the standard cache and the Workers KV cache. Much like the information on this page. Or at a minimum, having a section called "Caching" on the page with a link to that caching doc.

Until finding this documentation, I'd spent a week debugging why my Nextjs app (using SSR / app router) was showing old data on browsers in various locations. This was happening via initial load, page refresh and the router cache. It was very unstable. Once we added Workers KV as the cache store it solved all these issues 💥

Additional information

No response

onepixelsolid avatar Apr 24 '24 12:04 onepixelsolid

Thanks a bunch for the issue @scottmackenzzz :pray:

I'm sorry you had a hard time with the Next.js caching due to the difficult to find/unclear documentation on our side :sweat:

Hopefully https://github.com/cloudflare/next-on-pages/pull/796 and https://github.com/cloudflare/cloudflare-docs/pull/14859 should improve the situation :slightly_smiling_face:

Please let me know what you think :pray:

dario-piotrowicz avatar Jun 04 '24 12:06 dario-piotrowicz

Howdy @onepixelsolid, this is actually a new page at https://developers.cloudflare.com/pages/framework-guides/nextjs/ssr/caching/

kodster28 avatar Sep 18 '24 17:09 kodster28