Answers about middleware
Questions and answers from the Croct community about middleware.
Should the Croct proxy matcher exclude _next/static and image routes?
I copied a minimal middleware file from an example while wiring up @croct/plug-next and only later noticed it had no config.matcher at all. Which means the…
Two concurrent middleware-rewrite experiments means four page variants, this cannot scale
We implemented the standard middleware rewrite pattern for A/B tests: assign a variant in middleware, set a cookie for stickiness, rewrite to the variant…
How do I combine the Croct proxy with next-auth middleware in one middleware.ts?
Good morning. Our application already exports the next-auth middleware to protect the routes under /app and /settings. We are now integrating Croct, and the…
We built A/B tests with middleware rewrites and cookies, is a slot-based approach actually simpler?
Some context first because I think it matters. I consult for a mid-size B2B company running the classic Vercel pattern: middleware picks a variant, rewrites…
Docs say to export proxy but every tutorial I find uses middleware, which is right?
Setting up @croct/plug-next on a fresh Next.js app. The current docs tell me to create a middleware file that re-exports something called proxy, but every…
Upgraded to Next.js 15 and cookies() is async now, does the Croct proxy need changes?
Bumped a project to Next.js 15. Request APIs like cookies() and headers() are async now. Do the Croct proxy or my fetchContent calls need code changes, or…