0

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

According to the above doc, for cloud-front to gzip compress files it receives from origin, the response header from origin(s3) should contain Content-Length.

  1. How to know if s3 is sending the above information in the header to cloud-front
  2. How to set above in response header if it is not set already?
Aman Gupta
  • 103
  • 4

1 Answers1

3

How to edit response header of Amazon s3?

You don't.

The instructions you refer to are generic and apply to all potential origins wether S3 or custom.

The standard HTTP headers are set by the S3 API and can't be customised, the file size (which translates to a Content-Length HTTP-header) is part of the system defined meta data and set automatically.

You don't need to do anything special to serve compressed content in that regard. (As longs as your files meet the other relevant criteria of course).

How to know if s3 is sending the above information in the header to cloud-front

Simply do a HTTP request to retrieve a file from your S3 and check the response headers...

HBruijn
  • 77,029
  • 24
  • 135
  • 201