# Worker size limits (current)

As of the September 2026 change, Cloudflare checks only the uncompressed bundle size: 64 MiB on both Free and Paid plans. The old compressed-size limits (3 MB free / 10 MB paid) are gone. But "gone" does not mean "irrelevant": Next.js apps, ML-adjacent bundles, and kitchen-sink node_modules trees still hit 64 MiB.

## Measure before you deploy

```bash
wrangler deploy --outdir bundled/ --dry-run
```

Read the `Total Upload` value: that is your uncompressed bundle size, the number that counts against the 64 MiB limit. The `gzip` value is informational only now.

## What to trim first

1. Import only what you use. Tree-shaking works, but barrel imports (`import { x } from 'huge-lib'`) defeat it when the library has side effects.
2. Move heavy assets out of the bundle: put them in R2 or Workers Static Assets instead of importing binaries into the Worker.
3. Check for duplicated dependencies: two versions of the same library bundled twice is the most common silent bloat.
4. Node polyfill shims add weight. If `nodejs_compat` is on and you import a package that pulls shims for half of Node, that is bundle weight for APIs that throw at runtime anyway.

## Related limits to keep in mind

- CPU time: 10 ms per request on Free, 30 seconds default on Paid (up to 5 min configurable). Bundle size and CPU are different axes; a small Worker can still time out.
- Static asset files: 20,000 per Worker version on Free, 100,000 on Paid, 25 MiB per file. Assets do not count against Worker size the same way.

## Checklist

- Add the dry-run size check to CI and fail the build over a threshold you set (e.g. 40 MiB) so growth is visible before it blocks a deploy.
- When a deploy fails on size, look at the bundle analyzer output first, not the limit: the fix is almost always one dependency.