1
votes

I am not sure whether Google PageSpeed is able to read header "Accept-Encoding" GZip compression from Amazon S3.

I keep getting Consider Fixing from PageSpeed although all the javascript and css file has been compressed by adding header "Accept-Encoding":"gzip".

Is there a way to fix this issue?

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html

Warning from PageSpeed File Headers

1

1 Answers

1
votes

all the javascript and css file has been compressed by adding header "Accept-Encoding":"gzip".

There are several problems with this statement.

  • Adding a header does not cause files to be compressed.

  • Accept-Encoding: gzip is not what you added. You added x-amz-meta-accept-encoding: gzip, which serves no purpose at all. The x-amz-meta-* headers are user-defined metadata; they have no meaning to web browsers or search engines.

  • Accept-Encoding: gzip is not what you need, anyway -- this is a request header sent by the browser, not a response header returned by the server. The response header and value that would indicate gzipped content is Content-Encoding: gzip.

  • You can add Content-Encoding: gzip to your objects in S3, and that is what you will need to do in order to satisfy this recommendation, but you have to actually compress your files manually, using gzip, then re-upload them to S3, before you change the header. Pretending files are compressed by setting the header without compressing the files will only make them unusable.