opennextjs-cloudflare: [BUG] Performance is unusably slow
Describe the bug
I have all the caching functionality enabled but ttfb still ranges from 1.2s to almost 3 seconds!
Most of my pages are staticky rendered. My landing page reads the ‘CF-IPCountry’ header to localise pricing to the customers IP address. I don’t have any middleware
CPU & wal times vary massively (i’d assume some pages need to be rendered, others can be pulled from cache?)
Unfortunately this makes this library almost completely un usable for almost all websites.
Am I doing something wrong? 3 seconds TTFB will cause customers to stop navigating to the site.
Steps to reproduce
Almost any @opennextjs/cloudflare deployment.
Expected behavior
Pages not to take 1-3 seconds to send first byte.
@opennextjs/cloudflare version
1.0.1
Wrangler version
^4.14.1
next info output
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.4.0: Fri Apr 11 18:33:40 PDT 2025; root:xnu-11417.101.15~117/RELEASE_ARM64_T6031
Available memory (MB): 49152
Available CPU cores: 16
Binaries:
Node: 22.14.0
npm: 10.9.2
Yarn: 1.22.22
pnpm: 9.12.1
Relevant Packages:
next: 15.3.1 // There is a newer version (15.3.2) available, upgrade recommended!
eslint-config-next: 15.2.3
react: 19.1.0
react-dom: 19.1.0
typescript: 5.8.3
Next.js Config:
output: N/A
⚠ There is a newer version (15.3.2) available, upgrade recommended!
Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
Read more - https://nextjs.org/docs/messages/opening-an-issue
Additional context
open-next.config.ts:
import { defineCloudflareConfig } from "@opennextjs/cloudflare";
import doQueue from "@opennextjs/cloudflare/overrides/queue/do-queue";
import kvIncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/kv-incremental-cache";
export default defineCloudflareConfig({
queue: doQueue,
enableCacheInterception: true,
incrementalCache: kvIncrementalCache,
});
the https://vercel-commerce-on-workers.web-experiments.workers.dev/ deployment’s TTFB seems to range from 500-800ms which is much more reasonable. Is anyone able to link to its repo so I can compare my configs/versions? I can’t find it.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 14
- Comments: 15 (2 by maintainers)
v1.2.0 contains some improvements.
The issue is still being worked on.
Any update here? With this issue the whole library is unusable.
You know what, This needs to be fixed. This is bad. Hope this helps
I can add from my side that I am almost sure it is happening “only” on startup, however, due to like 6-8sec of CPU in these cases, with pretty low number of guests (~300 / month) we already crossed 30mln milisec included in $5 plan.
CPU usage on startup is really crazy and there is for sure something blocking there. It hurts performance really bad.
@vicb @conico974
I am observing the exact same thing. The 30 mln milliseconds in the paid plan were gone in a about 4 days with not that much traffic