Say I have an s3 bucket as a cloudfront origin, and a behaviour that links requests to files from the S3 origin. If I add a viewer response Cloudfront function to this behaviour, and I set a Cache-Control response header in this function, will Cloudfront's caching layer use the information in this new Cache-Control header to determine how long to cache the response? Or will it still use the Cache-Control header set by the origin?
I would like to be able to override the caching behaviour using this viewer-response function if possible. If this is not possible, is there another way I can control the caching behaviour based on information in the request?
OK.. thanks for the info. On a similar note, if I have a viewer-request function that directly returns a response, does cloudfront cache that response? And if i set a Cache-Control header in that response will that be used by cloudfront? or is that only for the viewer's browser?