Summary
Static assets (.js, .css, .html, .json, .svg) should be gzip-compressed before uploading to S3, with Content-Encoding: gzip set. This reduces download sizes by 60-80% and speeds up page loads.
Current Behavior
Assets are uploaded raw to S3. CloudFront can compress on-the-fly, but pre-compression is more efficient and reduces Lambda/CloudFront compute.
Expected Behavior
- Compress text-based assets with gzip before uploading
- Set
Content-Encoding: gzip on compressed S3 objects
- Skip already-compressed formats (
.png, .jpg, .woff2, .br)
- Log compression savings (e.g., "main.js: 450KB → 120KB (73% smaller)")
Files to Modify
cli/internal/serverless/aws_s3.go — Add gzip compression step before PutObject
Compressible Extensions
.js, .css, .html, .json, .svg, .xml, .txt, .map, .mjs
Difficulty: Easy · Language: Go
Summary
Static assets (
.js,.css,.html,.json,.svg) should be gzip-compressed before uploading to S3, withContent-Encoding: gzipset. This reduces download sizes by 60-80% and speeds up page loads.Current Behavior
Assets are uploaded raw to S3. CloudFront can compress on-the-fly, but pre-compression is more efficient and reduces Lambda/CloudFront compute.
Expected Behavior
Content-Encoding: gzipon compressed S3 objects.png,.jpg,.woff2,.br)Files to Modify
cli/internal/serverless/aws_s3.go— Add gzip compression step beforePutObjectCompressible Extensions
.js,.css,.html,.json,.svg,.xml,.txt,.map,.mjsDifficulty: Easy · Language: Go