Add dateUpdated param to assist with cache busting #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have recently started using the AWS Serverless transformer with Imager X and it's been working really great!
We discovered an issue today with image edits (focal point, crop, etc.) not cache busting CloudFront. These edits occur to the original image and the filename (key) remains the same. This means that the base64 encoded string is also the same and does not automatically cache bust the CloudFront distribution. The original image is being cache busted by Craft's own support for CloudFront invalidations but any transforms are not. If the base64 encoded string is tweaked, then it works and I can see my changes.
To workaround this, I am including the original image's dateUpdated timestamp in the parameters sent to Lambda. This is working great for me. I can make any updates to the image and then I can see the transform being regenerated immediately. The Lambda functon doesn't care about this extra data and simply ignores it.
I feel this could work well for others so contributing it here. Let me know if you have any thoughts, questions or concerns.