Skip to content

Bypass the worker to serve static pages #138

Open
@Martin-C-Listwan

Description

@Martin-C-Listwan

Describe the bug

Pre-rendered static pages (e.g., /helloWorld) are being incorrectly served from /cdn-cgi/_cf_seed_data instead of the /assets folder. This causes unnecessary worker invocations and CPU spikes of 200-300ms per page visit.

Fix would require moving the content inside of "/cdn-cgi/_cf_seed_data" to the root of the "/assets" folder. I manually moved a test "test.html" into my assets folder and can confirm that visiting "/test" on my deployed website doesn't hit my worker which is the expectation.

image

Steps to reproduce

  1. Create default nextjs project for workers.
  2. Deploy
  3. Run tail worker
  4. Expectation is that visiting the static home page should not be hitting your tail worker

Expected behavior

Pages pre-rendered as static should not hit your worker
Static content should be served directly from /assets

@opennextjs/cloudflare version

0.2.1

Node.js version

22.1

Wrangler version

3.88

next info output

Operating System:
  Platform: darwin
  Arch: arm64
Binaries:
  Node: 22.1.0
  npm: 10.7.0
  Yarn: 1.22.19
  pnpm: 8.4.0
Relevant Packages:
  next: 14.2.5 // An outdated version detected (latest is 15.0.3), upgrade is highly recommended!
  eslint-config-next: 14.2.5
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.6.3
Next.js Config:
  output: N/A

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions