The function gets invoked when CloudFront receives a response from origin and before hitting the cache.Image Optimization using Amazon CloudFront and AWS Lambda defines the allowed dimensions, default dimensions and how much variance from allowedĪllowedDimension : [ // end of if block checking response statusCode Looking Deeper at Functions:Ĭode snippet 1 – manipulates request uri 'use strict' Ĭonst querystring = require('querystring') Static resources like images should have a long Time to Live (TTL) as possible to improve cache-hit ratios. Note: Step 2,3 and 5 are executed only when the object is stale or does not exist in cache. The generated image is persisted back to the bucket before sending to CloudFront. A network call is made to the S3 bucket (origin) to fetch the source image and resized.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |