0

I have a cloudfront distribution in front of a REST API server. Just for now, I need to disable cache, so I'm using the Managed-CachingDisabled policy.

I can't get any responses to return as gzipped. I'm using cURL passing --compressed and the response has a Content-Length header and is between 1,000 and 10,000,000 bytes and is application/json.

Per the docs

Make sure the TTL values in the cache policy are set to a value higher than zero. When you set the TTL values to zero, caching is disabled and CloudFront doesn’t compress content.

Do you really need to have caching enabled for "Compress Objects Automatically" to work?

Can I just use a policy that sets cache default to 0 and max 24h then have my origin (REST API) return a Cache-Control: max-age=0

rynop
  • 219
  • 4
  • 15

1 Answers1

0

I've confirmed this does work. This is a showstopper for me however:

CloudFront is busy: In rare cases, when a CloudFront edge location is unusually busy, some files might not be compressed.

In my testing I saw CF not compressing quite frequently

rynop
  • 219
  • 4
  • 15