Cloudfront: How to disable cache for specific querystrings?

Viewed 281

In a CloudFront behavior, I can specify "forward all [querystrings], cache based on whitelist", which will do exactly that, but how do I tell CloudFront to not cache at all for a given querystring and just to always forward the request and return the response?

1 Answers

When creating a cloudfront distro, click create a new policy

enter image description here

Then when making the policy, go to the "Query Strings" section and click on "All Except"... and then type in your query strings. That way you can cache all query strings except for the specific one's you want. If you already have a cloudfront distro, just click on edit policy or create a new poicy for it.

enter image description here

Related