Bundle Size & Code Optimization
Reduce Worker bundle size and CPU usage so your edge code loads faster and runs within limits.
Why Bundle Size Matters
Workers have a script size limit (1 MB compressed on the free plan, more on paid).
Smaller bundles mean:
- Faster parse and startup
- Lower memory footprint
- Reduced cold-start impact
Optimizing your code is a direct performance win at the edge.
Measure Before Optimizing
Wrangler reports your bundle size on every build. Always measure first.
wrangler deploy --dry-run
# Total Upload: 142.18 KiB / gzip: 38.94 KiBAll lessons in this course
- Caching Strategies
- Cold Starts & Warmups
- Monitoring & Logging
- Bundle Size & Code Optimization