Monday, July 6, 2009

How to lower your Amazon S3 bills with GZIP and CloudBerry Explorer PRO

Note: this post applies to CloudBerry Explorer PRO 1.5.2 and later.

Most of popular web server support serving contents using gzip, at the same time most popular web browsers recognize GZIP header and decompress the files on the fly.

Even though Amazon S3 has most of the feature of a full-fledged web server, it lacks supporting GZIP in a transparent way. In other way you have to manually compress the files using GZIP and setup the Content-encoding header to gzip.

Why should I care about GZIP?

Well, first of all GZIP helps you to serve your web content faster. HTML pages being a simple text files can compress up to 20% of the original size and thus can be served 5(!) times faster. As a result making user experience much better!

What’s more with Amazon S3 it is much more important because you have to pay storage and transfer costs. Just imaging your monthly bills can get down to 20% if you store your content compressed and serve it using gzip.

How CloudBerry Explorer PRO can help?

CloudBerry Explorer PRO compression use gzip algorithm, so all files copied to Amazon S3 could be available through HTTP 1.1. It means that if you need to put html file to s3 you have to turn compression ON and copy files. To turn compression on go to Tools| Options| Advanced and check appropriate checkbox.

clip_image002

The file will be placed to s3 with the appropriate HTTP header set automatically:

Content-Encoding=gzip

To verify the header select the file that you’ve copied to S3 and click Set HTTP Headers on the toolbar. You will see Content-Encoding header in the list set to gzip.

clip_image004

Also notice that the original file size was about 11K, and it is less than 3K on stored on Amazon S3.

clip_image006

Important note: chunking should be off if you want to serve your files though http. It is off by default as of version 1.5.2, but older customers should check Tools| Options| Advanced.

CloudBerry Lab was inspired by the blog post Serve gzipped content from Amazon S3 and we would like to thank you the author David Arthur for the idea and for mentioning CloudBerry Explorer in his blog.

Please also check out Serving GZipped javascript files from Amazon CloudFront by Ken Weiner for more info on the subject

Conclusion

CloudBerry Explorer PRO makes it extremely easy to serve gzip content from Amazon S3. Basically you don’t have to do anything special, just turn compression on and everything else will happen automatically.

If you came to this post by chance you should know that CloudBerry S3 Explorer PRO is a Windows product that you can download here . It is currently in beta and FREE, so hurry up to get your copy! ;-)

0 comments: