Search code examples
amazon-web-servicesaws-cloudformationamazon-cloudfront

CloudFront ForwardedValues ambiguous documentation


I'm configuring my CloudFront using CloudFormation, and on the AWS documentation page for the ForwardedValues property, we can see the following statement:

If you specify true for QueryString and you don't specify any values for QueryStringCacheKeys, CloudFront forwards all query string parameters to the origin and caches based on all query string parameters.

The word in bold (caches) are causing some confusion, as the meaning of this sentence is completely dependent on caches being a verb or caches being a noun:

  • Verb: CloudFormation will cache the queryparameter
  • Noun: CloudFormation will forward the queryparameter to the cache, but it will not cache the queryparameters

If I don't specify the QueryStringCacheKeys, what is the behaviour of CloudFront?


Solution

  • If you don't specify the QueryStringCacheKeys, but only this:

    ForwardedValues:
      QueryString: true
    

    CloudFront will Forward all, cache based on all, which means that the request will be cached based on url+querystring and that the querystring is forwarded to the underlying system.

    You can read more on this in the AWS documentation here.


    enter image description here