CloudFront CDN (No GZip) vs Webserver / Local For all CSS / JS CloudFront CDN (No GZip) vs Webserver / Local For all CSS / JS wordpress wordpress

CloudFront CDN (No GZip) vs Webserver / Local For all CSS / JS


You can pre-gzip the JavaScript and CSS files, upload them to S3 with an application/x-gzip HTTP header, then have CloudFront serve them out.

If you automate the process as part of your build/deployment workflow, it's pretty easy to maintain.


After spending some time testing I have found the best way for our workflow is to have the css / js assets gzip on the server rather than serving from cloudfront.

It just seems way faster to serve the gzipped files on the server side than to serve non-gzipped files from cloudfront.

I feel the suggestion that @Ryan Parman makes perfect sense if we were not editing the css/js very often. I suppose there are some ways to create a script to sync the css/js after editing but for the current project what I have suggested above works like a charm and is fast!