You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the Serverless Image Handler, which utilizes a CloudFront distribution to cache images. My origin S3 buckets have versioning enabled. However, I have encountered an issue where CloudFront does not respect the versionId query parameter and always retrieves the latest version of an image. Or maybe CloudFront respect that but Lambda does not?
I have taken the step of configuring CloudFront to pass the versionId query parameter, but unfortunately, it does not seem to be working as expected. I'm unsure of what I might be missing or if there is something else I need to consider. Could you please provide some guidance or suggestions on how to address this issue?
The text was updated successfully, but these errors were encountered:
@barth12 Serverless Image Handler does not currently support the ability to manage versions of the original image. We will add this to the backlog to review if support might be added.
Hi @barth12,
This isn't something we currently plan to implement. However, if you'd like to implement it yourself, the following is what I would expect would need to be changed:
queryStringBehaviour would need to allow the version query parameter for both cache and originRequestPolicy. Location
The ImageHandlerEvent queryStringParameters interface should include version. Location
You'd have to extract the version query parameter out of the request in the setup method
That value would need to be passed into the getOriginalImage call.
In the getOriginalImage call, include the VersionId parameter in the imageLocation object used to make the request. Location
It's worth noting that the backend lambda would require the s3:GetObjectVersion permission for that object, though that is included by default in the current version of SIH.
Let me know if that ends up working for you,
Simon
I am using the Serverless Image Handler, which utilizes a CloudFront distribution to cache images. My origin S3 buckets have versioning enabled. However, I have encountered an issue where CloudFront does not respect the versionId query parameter and always retrieves the latest version of an image. Or maybe CloudFront respect that but Lambda does not?
I have taken the step of configuring CloudFront to pass the versionId query parameter, but unfortunately, it does not seem to be working as expected. I'm unsure of what I might be missing or if there is something else I need to consider. Could you please provide some guidance or suggestions on how to address this issue?
The text was updated successfully, but these errors were encountered: