Skip to content

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Jun 2, 2025

Adds the _headers file to the NextJS workers template. This will allow browser caching on static and immutable files that NextJS generates, since Cloudflare Static Assets have the header Cache-Control: public, max-age=0, must-revalidate by default.

A related issue has opened on the OpenNext repository: opennextjs/opennextjs-cloudflare#624 .

Supersedes #9131 + #9264


  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because: It's adding a static file
  • Wrangler / Vite E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because: not affected
  • Public documentation
  • Wrangler V3 Backport
    • TODO (before merge)
    • Wrangler PR:
    • Not necessary because: not a wrangler change

@vicb vicb requested a review from a team June 2, 2025 17:28
@vicb vicb requested a review from a team as a code owner June 2, 2025 17:28
Copy link

changeset-bot bot commented Jun 2, 2025

🦋 Changeset detected

Latest commit: 1e4d64c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-cloudflare Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vicb vicb added e2e Run wrangler + vite-plugin e2e tests on a PR c3-e2e Run c3 e2e tests on a PR labels Jun 2, 2025
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Jun 2, 2025
Copy link

@windsurf-bot windsurf-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🤙

Copy link
Contributor

github-actions bot commented Jun 2, 2025

A Wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15417642931/npm-package-wrangler-9442
Prereleases for other packages:

cloudflare-workers-bindings-extension:

wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15417642931/npm-package-cloudflare-workers-bindings-extension-9442 -O ./cloudflare-workers-bindings-extension.0.0.0-vf2b3569f9.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-vf2b3569f9.vsix

create-cloudflare:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15417642931/npm-package-create-cloudflare-9442 --no-auto-update

@cloudflare/kv-asset-handler:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15417642931/npm-package-cloudflare-kv-asset-handler-9442

miniflare:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15417642931/npm-package-miniflare-9442

@cloudflare/pages-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15417642931/npm-package-cloudflare-pages-shared-9442

@cloudflare/unenv-preset:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15417642931/npm-package-cloudflare-unenv-preset-9442

@cloudflare/vite-plugin:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15417642931/npm-package-cloudflare-vite-plugin-9442

@cloudflare/vitest-pool-workers:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15417642931/npm-package-cloudflare-vitest-pool-workers-9442

@cloudflare/workers-editor-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15417642931/npm-package-cloudflare-workers-editor-shared-9442

@cloudflare/workers-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15417642931/npm-package-cloudflare-workers-shared-9442

@cloudflare/workflows-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/15417642931/npm-package-cloudflare-workflows-shared-9442

Note that these links will no longer work once the GitHub Actions artifact expires.

@vicb vicb added the every-os label Jun 3, 2025
@vicb vicb removed every-os e2e Run wrangler + vite-plugin e2e tests on a PR labels Jun 3, 2025
@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Jun 3, 2025
@vicb
Copy link
Contributor Author

vicb commented Jun 3, 2025

Thanks Dario!

@vicb vicb added this pull request to the merge queue Jun 3, 2025
Merged via the queue into main with commit 4996b88 Jun 3, 2025
20 checks passed
@vicb vicb deleted the vicb/pr-9131 branch June 3, 2025 13:47
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Jun 3, 2025
@workers-devprod workers-devprod mentioned this pull request Jun 3, 2025
@lrapoport-cf lrapoport-cf mentioned this pull request Jun 3, 2025
12 tasks
emily-shen pushed a commit that referenced this pull request Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c3-e2e Run c3 e2e tests on a PR

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants