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