I\'ve been through quite a few suggestions given on this topic from other posts on Stackoverflow, but I\'m still not successfully getting it to work.
The website or
The process should look like this:
index.html.gz
).gz
extension (file is now called index.html
but content is gzipped)Content-Type
based on what file it is andContent-Encoding
to gzip
When linking to a gzipped stylesheet in your HTML markup just specify the name without the .gz
extension.
A great site to test if the configuration works is http://gzipwtf.com/
Also don’t forget to invalidate the CloudFront cache if the file you’re trying it out with is cached.
edit:
To not fiddle around with this stuff by hand all the time I suggest you automate the process of uploading and setting headers in some kind of build process. s3_website is a nice Ruby gem to get started but there are other command line tools or Grunt plugins available as well.