I was reading and watching videos about aws lambda, s3 and CloudFront(CF). I'd like to confirm here, that I understand (or not) the concept of aws cloudfront and more generaly CDNs.
aim: I'd like to serve images from my app via CF. I intend to deploy aws lambda function. In scenario that I depict - my lambda function is simple flask app with probably just one endpoint. POST endpoint implementing image upload (Creates checsum from a file, checks if the file checksum is already in s3 - save or not and return image). Image resize, runs only if the arguments for it are provided via query string. All images would be stored (original, resized, rotated etc.). S3 is an origin for CF.
deployment: As I use python - I want to use zappa as a deployment tool.
example PROBLEM:
8:00: User is uploading image from Australia. Image was not there before so it is saved to S3 and returned.
9:00 same user is asking for thumbnail of the image. Image is resized and returned. Here I assume that request for image resize (for example https://app.org/resize/image1.jpeg?width=80&height=80) is saved on Australian edge node of cloudfront together with response (image.jpg 80x80).
10:00 user is asking for the same thumbnail with the same query string - he gets image.jpg 80x80 from Australian cloudfront edge cache.
Did I get it right?