Serve gzipped content from Amazon S3
Set the “Content-encoding” header to “gzip”. Really, it’s that easy.
Kthxbye.
Well, since you came all this way, I’ll give a little more detail. First, make a file.
Now gzip it.
Upload it.
Find a utility that can modify file headers on S3: S3Hub (OS X), Cloudberry S3 Explorer (Windows), or any of the various 3rd party libraries.
Set the Content-type header to whatever the appropriate content type is: text/plain, text/css, text/javascript, image/jpeg, etc.
Set the Content-encoding to gzip.
Pat yourself on the back.
Here’s three versions of a text file I made and gzipped. Note that with appropriate headers, file extensions don’t mean squat.
- http://mumrah-dot-net.s3.amazonaws.com/gziptest.txt.gz
- http://mumrah-dot-net.s3.amazonaws.com/gziptest.txt
- http://mumrah-dot-net.s3.amazonaws.com/gziptest
Go ahead and download one – you’ll see that the file is actually gzipped and your browser is doing the deflating on the fly. This is the same effect producted by mod_deflate in Apache.
-David
thanks!
you made my day! added a couple of points to my yslow! grade…
sambit
4 Aug 09 at 6:21 am
[...] 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 [...]
How to lower your Amazon S3 bills with GZIP and CloudBerry Explorer PRO | Tea Break
11 Aug 09 at 5:54 pm
[...] 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 [...]
How to lower your Amazon S3 bills with GZIP and CloudBerry Explorer PRO | Tea Break
11 Aug 09 at 5:54 pm