How query string cache works
In other word, you will only be charged when our server generates an image for you i.e. cache miss on our server.
Network flow between user request, Amazon's Cloudfront and Stencil's server
User's browser send a request to get an image. This image points to Query String URL integration that we have set up previously.
Images are cached on Amazon CloudFront. This is why Stencil image's load is so fast because we are using Amazon CloudFront to cache in multiple locations throughout the world.
If images are in CloudFront's cache, it will return the cache version (i.e. go to step 4 directly). Otherwise it will send a request to Stencil.
Stencil maintains a smart cache, we won't go into details on how it works but it can figure out whether you're generating the same image as before or it is a new image.
If a new image needs to be generated, your quota will be deducted. Otherwise, your usage remains unchanged.
Amazon CloudFront will cache this image returned by our server. Any subsequent requests will hit Amazon CloudFront.
To assist with issues, image response header contains some useful information to know whether cache is working as intended.