We use a storage extension to publish binaries to S3. The images, PDFs and movies are also cached with CloudFront and have 1 rule set to keep them cached for 1 hour.
We'd like to use the CloudFront API to flush items at publish time within the Custom Deployer, and only if they are newer. The code for CloudFront is working fine.
However, the task of identifying what items to flush is the challenge.
Is it possible to get the last modified date of the binary (multimedia Component) in the package and compare it with the last publish time? Is last publish time stored as part of the Binary or only the Page?
The other idea is to provide a metadata field on the multimedia component, flush cache, and get this field from the package at publish time.
Any other ideas?