user2560528
user2560528

Reputation: 105

AWS Cloudfront - Cache Behaviour - Path Pattern format

The documentation for the Path Pattern property is not exactly exhaustive.

The pattern to which this cache behavior applies. For example, you can specify images/*.jpg

Now, i understand the path pattern could be things like images/* and other simple variations but, can it be something like /path/*/latest/?

I can save that pattern but it doesn't seem to work as expected. It looks like Cloufront ignores everything after the * and caches everything below path/*, regardless of the fact that /path/*/latest is the top behaviour (0 order) with a TTL of zero.

To further clarify, i have a /path/* that i want to be served (and cached) by cloudfront, with the exception of one particular subpath, say path/*/latest that can be served by Cloudfront, but shouldn't be cached (hence i gave it a TTL of zero).

Upvotes: 3

Views: 2089

Answers (1)

Mark Kelly
Mark Kelly

Reputation: 563

The problem may be with the ordering of the behaviours. Does path/*/latest occur before /path/*? Cache behaviors are processed in the order in which they're listed in the CloudFront console

Upvotes: 2

Related Questions