serverless-sharp icon indicating copy to clipboard operation
serverless-sharp copied to clipboard

Cloudfront invalidation when source asset it updated

Open timkelty opened this issue 5 years ago • 3 comments

Currently if an s3 asset is updated/replaced (i.e. "Replace File" in your CMS), the resized versions will be cached in Cloudfront and therefore stale.

Could we trigger a CF invalidation when an s3 object is updated?

timkelty avatar Jul 31 '19 14:07 timkelty

This seems like it should be pretty-doable; however, I'd like to make it optional since CDN invalidations can add quite a bit of cost if not used efficiently.

An additional option is to support an additional parameter for version or something to that affect.

Mosnar avatar Aug 06 '19 12:08 Mosnar

I'd like to make it optional since CDN invalidations can add quite a bit of cost if not used efficiently

Yep.

Seems to be a bit of a tossup if this should be handled from your app or be integrated as part of the lambda.

timkelty avatar Aug 06 '19 13:08 timkelty

An additional option is to support an additional parameter for version or something to that affect.

sounds a good option

gregBerthelot avatar Mar 31 '20 13:03 gregBerthelot