CloudFront – Setting Object Caching

amazon-cloudfrontamazon-web-services

I want to set the "Object Caching" of my CloudFront distribution with S3 origin to "Customize".

I follow these steps on the console:

  1. go to the "behavior" tab of the relevant distribution
  2. "Edit Behavior" of the relevant behavior(s)
  3. change the radio button for "Object Caching" from "Use Origin Cache Headers" to "Customize"
  4. leave the default values for "Minimum TTL", "Maximum TTL", and "Default TTL" untouched
  5. click "Yes, Edit"

When I go back to the behavior the "Object Caching" is reverted back to "Use Origin Cache Headers", even after allowing time to sync the settings across the edge servers.

Is this expected behavior, and, if so, why? Or is this a bug?

If it's expected behavior, what steps should I take instead?

Best Answer

It's not a bug.

It's more like a case of imprecise descriptions of what the radio buttons actually mean.

  • Use Origin Cache Headers actually means "Use origin cache headers constrained by standard values for CloudFront internal TTLs."

  • Customize actually means "Use origin cache headers constrained by custom values for CloudFront internal TTLs."

The origin cache headers are always used, with either selection. The only difference is whether you're using the standard 0/86400/31536000 values or custom values... so "Customize" with no customized values is exactly the same behavior as "Use Origin Cache Headers," which is why the UI reverts the way it does.

It is not clear why the UI uses descriptions that are somewhat at odds with the actual behavior.