Platform Limits: File Size, Upload, Cache, and Headers
Cloudflare limits on per-file size, plan upload caps, cacheable objects, Worker bundles, and HTTP headers—and how to verify them.
This page summarises Cloudflare documentation on size and count limits that block deploys, uploads, and caching: the recurring 25 MiB asset cap, Maximum Upload Size by plan, cacheable file ceilings, Workers script and static-asset quotas, and request/response header totals. Limits often depend on plan, product (Pages vs Workers vs zone CDN), and tooling such as Wrangler version—not on a single global number.
Per-file asset limits: why deploys fail at 25 MiB
Section titled “Per-file asset limits: why deploys fail at 25 MiB”A 25 MiB maximum applies to one uploaded file in several products. Hitting it produces build or upload errors (for example Blazor WebAssembly bundles).
For Cloudflare Pages, the maximum size for a single site asset is 25 MiB. For Workers static assets, the individual file size is 25 MiB on Free and Paid plans alike; increasing the file count on paid plans does not change this cap.
Cloudflare’s Blazor deployment guide states that if dotnet.wasm exceeds the limit, you should reduce asset size or remove *.wasm from the output and load Brotli-compressed files instead.
Serving files larger than 25 MiB on Pages
Section titled “Serving files larger than 25 MiB on Pages”When a single asset must exceed 25 MiB, Pages limits recommend uploading to R2 and serving via a public bucket or a custom domain (for example static.example.com).
Direct upload methods and file counts
Section titled “Direct upload methods and file counts”Direct Upload for Pages documents method-specific caps:
| Upload method | File limit | File size |
|---|---|---|
| Wrangler | 20,000 files (Free); up to 100,000 on paid when configured | 25 MiB |
| Drag and drop | 1,000 files | 25 MiB |
Oversized drag-and-drop assets show a warning and are not uploaded; you cannot replace one failed file—you must re-upload the whole project.
Request body upload limits (Maximum Upload Size) and HTTP 413
Section titled “Request body upload limits (Maximum Upload Size) and HTTP 413”Maximum request body size for traffic through Cloudflare’s CDN depends on the Cloudflare account plan (not the Workers plan alone). Exceeding the configured limit returns 413 Request Entity Too Large.
From default cache behavior — upload limits:
| Plan | Max upload size |
|---|---|
| Free | 100 MB |
| Pro | 100 MB |
| Business | 200 MB |
| Enterprise | Up to 5 GB |
Enterprise customers can self-serve any value up to 5 GB. Uploads larger than 5 GB require additional configuration — contact your account team.
— Cloudflare, Default cache behavior
Workers platform limits align: Free and Pro 100 MB, Business 200 MB, Enterprise up to 5 GB (self-serve on the zone Network page as Maximum Upload Size). Limits above 5 GB need your account team or Cloudflare Support.
Error 413 notes that setting Maximum Upload Size below an incoming request’s size also causes 413. Mitigations include chunking uploads, using a DNS-only record, or upgrading the plan.
Enterprise customers can configure a zone’s CDN Maximum Upload Size up to 5 GB from the dashboard without contacting support for each change, as described in Enterprise self-serve CDN upload limits.
Cacheable response size limits
Section titled “Cacheable response size limits”Caching is separate from upload limits: an object can be accepted upstream yet not stored in Cloudflare’s cache if it exceeds the cacheable file limit.
From cacheable size limits:
- Free, Pro, and Business: 512 MB per file
- Enterprise: default 5 GB per file (contact account team or Support to raise further)
Configure cache by status code states the same 512 MB (Free/Pro/Business) and 5 GB (Enterprise) maximum caching limit per file.
If a response is too large to cache, you may see Cf-Cache-Status: MISS on every request even when the response looks cacheable—see Workers cache debugging.
Workers script size: 64 MiB uncompressed bundle
Section titled “Workers script size: 64 MiB uncompressed bundle”Worker deploy size is measured on the uncompressed bundle, not gzip.
Cloudflare now only checks the uncompressed size of your bundle, which is 64 MiB across all plans.
— Cloudflare, Deploy larger Workers — up to 64 MiB
Workers platform limits confirm 64 MiB for Free and Paid and state there is no compressed size limit—only Total Upload from a dry run counts.
Check size before deploy:
wrangler deploy --outdir bundled/ --dry-runThe Total Upload line is the uncompressed bundle size; gzip is informational only.
Larger bundles can affect startup time. The global scope may take up to 1 second to parse and execute (raised from 400 ms)—see Worker startup time limit.
Static asset and Pages file count limits
Section titled “Static asset and Pages file count limits”Files per Worker version
Section titled “Files per Worker version”| Plan | Files per Worker version |
|---|---|
| Free | 20,000 |
| Paid / Workers for Platforms | 100,000 |
Per-file size stays 25 MiB. To use 100,000 files, Wrangler 4.34.0 or higher is required—older Wrangler enforces 20,000 (Increased static asset limits).
Files per Pages site
Section titled “Files per Pages site”Pages limits: 20,000 files on Free; paid plans up to 100,000 when PAGES_WRANGLER_MAJOR_VERSION=4 is set in project settings (Increased Pages file limit).
Workers Sites legacy notes: a 25 MiB limit per page or file, and large manifests count toward script size (Wrangler legacy configuration).
URL, header, and message size limits
Section titled “URL, header, and message size limits”Connection limits and Workers request and response limits define edge HTTP constraints:
| Limit | Value |
|---|---|
| URL size | 16 KB (Error 414 documents 414 if URI length exceeds 32 KB in support material—connection limits cite 16 KB for URLs) |
| Request headers (total) | 128 KB |
| Response headers (total) | 128 KB |
| Response body | No enforced limit on Workers; CDN cache limits still apply |
Header limits were raised to 128 KB total for request and response (previously 32 KB total, 16 KB per header), reducing 413 and 520 errors for large cookie sets or CSP headers—see Increased HTTP header size limit.
WebSocket messages (Workers, Durable Objects, Browser Rendering) may be up to 32 MiB (was 1 MiB)—Workers WebSocket message size limit. Workers platform changelog also notes JSRPC message size 32 MiB.
Workers Logs capture up to 256 KB of log events per invocation; beyond that, further context is not recorded (changelog).
Pages _headers and related caps
Section titled “Pages _headers and related caps”From Pages limits:
_headers: up to 100 rules; each header line up to 2,000 characters (larger headers via Pages Functions).
Workers static assets mirror _headers / _redirects counts (for example 2,100 total redirects).
Workers Builds limits (CI disk, CPU, environment variables)
Section titled “Workers Builds limits (CI disk, CPU, environment variables)”Workers Builds environment and hardware caps relevant to large projects:
| Metric | Free | Paid |
|---|---|---|
| Disk space | 20 GB | 20 GB |
| vCPU | 2 | 4 |
| Environment variables | Up to 64, each up to 5 KB | Same pattern per build env var increase |
Build timeout is 20 minutes (troubleshooting builds). Disk rose from 8 GB to 20 GB on all plans (Increased disk space for Workers Builds).
Stream and other upload paths
Section titled “Stream and other upload paths”Basic video uploads use simple form uploads for files smaller than 200 MB. Larger or resumable flows use different APIs; resumable uploads define chunk sizes (minimum 5,242,880 bytes unless the whole file is smaller, maximum chunk 209,715,200 bytes, divisible by 256 KiB).
These Stream limits are product-specific and separate from Pages 25 MiB or zone Maximum Upload Size.
Common mistakes
Section titled “Common mistakes”- Assuming gzip size limits Worker deploys—only uncompressed bundle size matters (64 MiB).
- Using old Wrangler and staying at 20,000 static files despite a paid plan (Wrangler 4.34.0+ required).
- Forgetting
PAGES_WRANGLER_MAJOR_VERSION=4on paid Pages projects for 100,000 files (Pages file limit increase). - Confusing request upload limits with cache limits—a 200 MB upload on Business does not mean a 512 MB response will cache on that plan.
- Large headers after migration—verify totals against 128 KB, not legacy 32 KB assumptions.
- Blazor / WASM over 25 MiB without compression strategy (Blazor guide).
How to check this on your site
Section titled “How to check this on your site”- Open Workers platform limits and Pages platform limits and note your plan’s file count, 25 MiB per-file cap, and upload row.
- In the Cloudflare dashboard, check the zone Network page for Maximum Upload Size if you see 413 on uploads (Error 413).
- Run
wrangler deploy --outdir bundled/ --dry-runand confirm Total Upload is under 64 MiB (Deploy larger Workers). - For cache misses on large files, compare object size to cacheable size limits and response headers to connection limits (128 KB).
- You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page looks wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact wording you are asking about.