Skip to content

Document CLOUDFLARE_CF_FETCH_ENABLED and CLOUDFLARE_CF_FETCH_PATH environment variables#28174

Open
petebacondarwin wants to merge 6 commits intoproductionfrom
devin/1770485206-cf-fetch-env-vars
Open

Document CLOUDFLARE_CF_FETCH_ENABLED and CLOUDFLARE_CF_FETCH_PATH environment variables#28174
petebacondarwin wants to merge 6 commits intoproductionfrom
devin/1770485206-cf-fetch-env-vars

Conversation

@petebacondarwin
Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin commented Feb 7, 2026

Summary

Documents two new Miniflare environment variables introduced in cloudflare/workers-sdk#12469:

  • CLOUDFLARE_CF_FETCH_ENABLED — disable cf.json fetching entirely (useful for non-JS Workers projects that don't want node_modules created)
  • CLOUDFLARE_CF_FETCH_PATH — override the default node_modules/.mf/cf.json cache location

Changes span two pages:

  • System environment variables reference — adds both variables to the supported list, and adds CLOUDFLARE_CF_FETCH_ENABLED=false to the example .env file
  • Miniflare get-started guide — expands the Request#cf Object section with env var usage examples for wrangler dev

Updates since last revision

  • Fixed .env example to only show CLOUDFLARE_CF_FETCH_ENABLED=false (removed CLOUDFLARE_CF_FETCH_PATH from the same example, since disabling fetching and setting a custom path together doesn't make sense)
  • Normalized list markers (*-) for three pre-existing entries (WRANGLER_HTTPS_KEY_PATH, WRANGLER_HTTPS_CERT_PATH, WRANGLER_R2_SQL_AUTH_TOKEN)

Key items for review

  • Verify the anchor link /workers/testing/miniflare/get-started/#requestcf-object resolves correctly (confirmed working in preview)
  • Confirm the described precedence behavior (explicit cf option > CLOUDFLARE_CF_FETCH_ENABLED > CLOUDFLARE_CF_FETCH_PATH > default) matches the implementation in workers-sdk#12469

Documentation checklist

  • Is there a changelog entry (guidelines)? If you don't add one for something awesome and new (however small) — how will our customers find out? Changelogs are automatically posted to RSS feeds, the Discord, and X.
  • The change adheres to the documentation style guide.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.
  • Files which have changed name or location have been allocated redirects.

Link to Devin run | Requested by: @petebacondarwin


Open with Devin

@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 7, 2026

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/workers/ @cloudflare/workers-docs, @GregBrimble, @irvinebroque, @mikenomitch, @korinne, @WalshyDev, @cloudflare/deploy-config, @cloudflare/pcx-technical-writing, @cloudflare/product-owners, @cloudflare/wrangler, @mattietk, @cloudflare/dev-plat-leads
/src/content/docs/workers/wrangler/ @cloudflare/wrangler, @irvinebroque, @cloudflare/pcx-technical-writing, @cloudflare/product-owners

@elithrar
Copy link
Copy Markdown
Collaborator

elithrar commented Feb 7, 2026

/bonk review and fix any issues

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Feb 7, 2026

All fixes applied. Here's a summary of the review:

Review Summary

Verified correct (no changes needed):

  • Content accuracy: Both new env var descriptions match the implementation in workers-sdk#12469 (precedence order, accepted values "false"/"0", default behavior)
  • Anchor link: /workers/testing/miniflare/get-started/#requestcf-object will resolve correctly from the #### \Request#cf` Object` heading
  • get-started.mdx: The new section with shell examples is well-placed and accurate

Issues fixed:

  1. .env example showed CLOUDFLARE_CF_FETCH_ENABLED=true (the default) -- changed to false, which is more illustrative since users copying from this example likely want to disable the feature (system-environment-variables.mdx:113)

  2. CLOUDFLARE_CF_FETCH_PATH was missing from the .env example -- added it alongside CLOUDFLARE_CF_FETCH_ENABLED for completeness (system-environment-variables.mdx:114)

  3. Pre-existing list marker inconsistency -- three entries (WRANGLER_HTTPS_KEY_PATH, WRANGLER_HTTPS_CERT_PATH, WRANGLER_R2_SQL_AUTH_TOKEN) used * while all other entries used -. Normalized to - for consistency (system-environment-variables.mdx:81,85,91)

github run

@elithrar
Copy link
Copy Markdown
Collaborator

elithrar commented Feb 7, 2026

@petebacondarwin - I think we got better results here than Devin ;-)

Comment on lines +113 to +114
CLOUDFLARE_CF_FETCH_ENABLED=false
CLOUDFLARE_CF_FETCH_PATH=/tmp/.cf-cache.json
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It doesn't make sense to have enabled false and a custom path. I think one or the other is best here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixed — removed CLOUDFLARE_CF_FETCH_PATH from the .env example so it only shows CLOUDFLARE_CF_FETCH_ENABLED=false.

@petebacondarwin
Copy link
Copy Markdown
Contributor Author

@petebacondarwin - I think we got better results here than Devin ;-)

Yep. I think bonk seemed to do a bit better, although I made one comment.

Can I just do:

/bonk please can you fix the .env example to only show one of the two new env vars as setting enabled to false and a custom path together doesn't really make sense.

@petebacondarwin
Copy link
Copy Markdown
Contributor Author

/bonk please can you fix the .env example to only show one of the two new env vars as setting enabled to false and a custom path together doesn't really make sense.

@petebacondarwin
Copy link
Copy Markdown
Contributor Author

Looks like I'm not allowed to request bonk changes 😄

@ghost

This comment was marked as abuse.

@elithrar
Copy link
Copy Markdown
Collaborator

elithrar commented Feb 8, 2026

@petebacondarwin weird - you might not be in CODEOWNERS correctly. Let me check.

@github-actions
Copy link
Copy Markdown
Contributor

Hey there, we've marked this pull request as stale because there's no recent activity on it. This label is helps us identify PRs that might need updates (or to be closed out by our team if no longer relevant).

@github-actions github-actions Bot added the stale label Feb 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Hey there, we've closed out this pull request because it's been stale for a while and there's been no additional action on it. If these changes are still relevant, open a new pull request (or flag to us in a GitHub issue).

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

devin-ai-integration Bot and others added 3 commits April 17, 2026 23:06
…ironment variables

Add documentation for two new environment variables that control cf.json
fetching behavior in Miniflare:

- CLOUDFLARE_CF_FETCH_ENABLED: disable cf.json fetching entirely
- CLOUDFLARE_CF_FETCH_PATH: use a custom cache location for cf.json

Updates both the system environment variables reference page and the
Miniflare get-started guide.

Related: cloudflare/workers-sdk#12469
Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com>
Co-authored-by: elithrar <elithrar@users.noreply.github.com>
Remove CLOUDFLARE_CF_FETCH_PATH from the example since having both
enabled=false and a custom path together doesn't make sense.

Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com>
@petebacondarwin petebacondarwin force-pushed the devin/1770485206-cf-fetch-env-vars branch from c454cdd to fcfc6e4 Compare April 17, 2026 22:06
devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration
Copy link
Copy Markdown
Contributor

❌ Cannot revive Devin session - the session is too old. Please start a new session instead.

1 similar comment
@devin-ai-integration
Copy link
Copy Markdown
Contributor

❌ Cannot revive Devin session - the session is too old. Please start a new session instead.

@MattieTK
Copy link
Copy Markdown
Member

I think it would be sensible to let #28364 merge first so there's no conflicts

@petebacondarwin
Copy link
Copy Markdown
Contributor Author

@MattieTK and @haleycode - this is ready for review

@marciocloudflare
Copy link
Copy Markdown
Contributor

PCX triage note — PCX team pinged the assigned reviewer on 2026-04-17. Waiting for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:workers Related to Workers product size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants