1

when i use compressed (gzipped) static files from Amazon S3 like this parameter, it ubable to open this file i got error Content Encoding Error

what to do to access this css file with gzip from s3

My css file  link :  http://d2dbcr33josved.cloudfront.net/css/style_s3cloud.css

enter image description here

1 Answer 1

1

You need to manually gzip the files before uploading to S3. S3 doesnt do the gzip part, but will just server what you upload along with the headers which you set.

Your header setting is ok here. Just need to upload the gziped file: From Linux or OSX, this can be easily done with "gzip -9 style_s3cloud.css". Then upload the file.

Sign up to request clarification or add additional context in comments.

3 Comments

+1 for mentioning -9 for maximum compression. One additional note, the resulting file after running gzip will have a .gz extension. Don't upload the file with the the .gz -- upload it with the original name after compressing it with gzip.
after compressing this file i rename "style_s3cloud.css.gz" to style_s3cloud.css then upload it, but it not load any css
Did you forget the Content-Type : text/css. Can you clear the cache and try ? Looks like the old file is being saved due.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.