CloudFront invalidations are relatively expensive. 1000 paths per month are free and then each path is .5 cent. Running a lot of automated workflows with uploads can add up in cost.
Paths can include a wildcard and will handle all objects from that point and "sub-folders" (even though folders are not actually used, just keys to objects). Therefore, one way to minimize costs is to determine the highest level CloudFront path for files being uploaded and invalidate that prefix with a wildcard. To enable, a command parameter like InvalidateTop=true could be enabled. Maybe make it the default so as to automatically phase in cost savings.
CloudFront invalidations are relatively expensive. 1000 paths per month are free and then each path is .5 cent. Running a lot of automated workflows with uploads can add up in cost.
Paths can include a wildcard and will handle all objects from that point and "sub-folders" (even though folders are not actually used, just keys to objects). Therefore, one way to minimize costs is to determine the highest level CloudFront path for files being uploaded and invalidate that prefix with a wildcard. To enable, a command parameter like
InvalidateTop=truecould be enabled. Maybe make it the default so as to automatically phase in cost savings.