Use gzip-encoding to compress CSS & JS • Averages 60-90% reduction in size* • mod_gzip on Apache, or whatever you’re using * less made up than the previous stat Monday, January 30, 12
1. Upload two versions to S3. gzip and non-gzip Remember to set Content-Encoding on the gzip one 2. In your app, check the HTTP Accept-Encoding header and rewrite the asset urls to your gzip versions 3. Profit! Seriously, since your CloudFront costs will be cheaper Monday, January 30, 12
Advanced Just comments and whitespace, same source Minifies, renames variables and functions. Requires you to define things you don’t want changed. Aggressive, rewrites code Monday, January 30, 12