Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm serving up most of my static media from a CDN for my website. This includes images, videos, javascript files, and CSS files. YSlow and Google's Performance tool tell me that I should be gzip'ing this content. How can I gzip content served up by a CDN? Is there a way to store the content zipped on the CDN?

Would gzip'ing content from a CDN improve page load times? I don't care about the CDN bandwidth, but would be interested if it could actually load the page faster for the end user.

share|improve this question
up vote 3 down vote accepted

It will have to depend on the CDN you are using. Some CDNs support on-the-fly gzip compression (same functionality that you would get from enabling gzip in Apache or nginx). Other CDNs do not support gzip (last time I checked, CloudFront did not for instance).

You could pre-gzip files but that's something you will have to try to see if your CDN properly supports it.

Keep in mind, the "faster" page load in this case is because of the reduction in data transfer. A slow browser/computer is still going to be slow regardless.

Lastly, you should not be gzipping images/videos. Those should already be compressed already due to the format and you would just be wasting CPU and bandwidth to compress them.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.