That article is a little out of date, although the core concepts still work. The latest Javascript SDK has support for built-in fetching and caching. https://docs.growthbook.io/lib/js#built-in-fetching-and-caching
We use localStorage by default as a caching layer, which won't work in middleware, but there are 2 ways around this:
1. Specify a
localStorage
polyfill possibly using something like Edge Config
2. Specify a
fetch
polyfill that adds the Next.js-specific revalidate option to every request
The Node.js instructions show examples of setting these polyfills, but they aren't specific to Next.js middleware, so will likely need some tweaking: https://docs.growthbook.io/lib/js#nodejs