0
votes

I'm currently having an issue setting up a behavior in Amazon CloudFront.

I want all files under a certain directory to hit a specific pattern and set the Object Caching to "Custom" and Minimum TTL to 3600.

Sample Url: http://blah.com/images/default-source/test/test.jpg

I have a behavior setup as: Path Pattern: images/default-source/* (have also tried /images/default-source/*) Object Caching: Customize Minimum TTL: 3600

However, whenever I hit the sample Url, it returning a header of "Cache-Control: public, max-age=7776000".

I feel like everything is configured correctly, but clearly something isn't working properly.

1

1 Answers

2
votes

That setting doesn't overwrite the cache-control header - it just affects how long cloudfront (not the browser) caches objects.

In any case it is just a lower bound - cloudfront uses the maxage value (unless it is less than the minimum ttl)

This table summarizes the behaviour but in short it sounds you'll need to set those cache-control headers yourself if you're not happy with the defaults something on your server is setting.