Skip to content

Docs on Workers Builds - #32554

Open
mvvmm wants to merge 5 commits into
productionfrom
docs-on-workers-builds
Open

Docs on Workers Builds#32554
mvvmm wants to merge 5 commits into
productionfrom
docs-on-workers-builds

Conversation

@mvvmm

@mvvmm mvvmm commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note: This is a copy of #32438 by @ericclemmons.

Summary

This repo times out at 30 minutes on Workers Builds due to issues with 8 GB of memory (vs. GitHub's 16 GB).

Until that's resolved, there are a few fixes that I found were able to get ~11m builds:

  • fix: reduce finalization memory usage rolldown/rolldown#10554 is the root issue, causing memory pressure ~5 minutes in and hanging until the timeout at 30 minutes.

  • Switch to Cloudflare Images (to avoid spending 20+ minutes on Sharp image compression at build time)
    https://docs.astro.build/en/guides/integrations-guide/cloudflare/#imageservice

    (If this isn't desirable, commit hook or CI job to do this optimistically instead of every single build?)

  • (Won't do) Revert fix: move Astro cache outside node_modules #31192, because Workers Builds expects the default cache location at node_modules/.astro

  • Add this repo to Workers Builds on the Cloudflare Docs' account

  • Add GITHUB_TOKEN secret to prevent MDX errors that call the GitHub API:

    19:58:52 [ERROR] Error: A request to the GitHub API (https://api.github.com/repos/cloudflare/templates/commits?sha=main&per_page=1) was made without a token and was rate limited.
  • Validate Cloudflare Images works as a replacement to sharp (which reduced both build times & memory)

  • Validate Astro Cache in node_modules/.astro doesn't regress. (Workers Builds cache dependencies based on lockfile and caches the framework, restoring them in that order. So in theory, even if dependencies don't change, each build will re-cache the framework)

Screenshots (optional)

Before

Screenshot 2026-07-30 at 5 06 47 PM

After (cold cache)

Screenshot 2026-07-30 at 5 08 08 PM

After (warm cache)

Screenshot 2026-07-30 at 5 07 24 PM

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.

@mvvmm
mvvmm requested review from a team and kodster28 as code owners August 5, 2026 21:25
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review

⚠️ 1 warning found in commit 0956a93.

👉 Fix in your agent 👈
Fix the following review findings in PR #32554 (https://github.com/cloudflare/cloudflare-docs/pull/32554).

Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g. the fix requires disproportionate effort for minimal benefit,
  or the finding is factually incorrect), explain why
- If you need clarification before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order

After triaging, follow this order:
1. Post a comment on this PR for any findings you are skipping, with the finding ID and your reasoning.
2. Then commit the fixes for the legitimate findings.

The comment must come before the commit — the bot reads PR comments when a new
push triggers a review, so skip comments posted after the push will be missed.

---

## Conventions

### Warnings (1)

#### CV-df71e2b2b374 · Scope accuracy
- **File:** PR-level finding
- **Issue:** The description describes build configuration and dependency changes, but does not mention the modifications to worker/index.ts and worker/index.preview.ts (20 total added lines).
- **Fix:** Add an explanation of the changes to worker/index.ts and worker/index.preview.ts so reviewers understand how they relate to the Workers Builds setup.

Code Review

This code review is in beta and may not always be helpful — use your judgment.

No code review issues found.

Conventions

Warnings (1)
File Issue
PR Scope accuracy — The description describes build configuration and dependency changes, but does not mention the modifications to worker/index.ts and worker/index.preview.ts (20 total added lines). Fix: Add an explanation of the changes to worker/index.ts and worker/index.preview.ts so reviewers understand how they relate to the Workers Builds setup.

Style Guide Review

No style-guide issues found.

Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.
/rebase Rebases the PR branch against production. On conflict, attempts to resolve automatically using AI. Stops with an explanation if confidence is not high enough.

@github-actions github-actions Bot added the size/m label Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

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

Pattern Owners
*.ts @cloudflare/content-engineering, @kodster28
package.json @cloudflare/content-engineering
* @cloudflare/product-owners

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@mvvmm

mvvmm commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Skipping CR-453e5fe5f2e4 as originally filed — the Via: image-resizing passthrough has been removed entirely from both workers. Image Resizing subrequests now reach ASSETS directly because we reverted run_worker_first: false in an earlier commit. No scoped bypass is needed.

@mvvmm

mvvmm commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Correction to my previous comment: CR-453e5fe5f2e4 is being addressed — the Via: image-resizing bypass is being scoped to /_astro/ paths only, so preview-specific routes (robots.txt, sitemap, openapi.json, etc.) are unaffected.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants