elementor / wp2static-addon-s3

S3 deployment Add-on for WP2Static
The Unlicense
35 stars 23 forks source link

reported issue with CF invalidation #9

Closed leonstafford closed 4 years ago

leonstafford commented 4 years ago

from https://forum.wp2static.com/-181/cloudfront-cache-invalidation-s3-delpyment-v10-alpha-006#post-1

Hi, found some more issues in the S3 module. For cache invalidation, you are using the s3 Key and Secret s3AccessKeyID/s3SecretAccessKey instead of cfAccessKeyID/cfSecretAccessKey - may be confusing to people who store different credentials for each.

Also, passing the credentials into the CloudFrontClient is not working as coded up. I rewrote it locally as

$client = \Aws\CloudFront\CloudFrontClient::factory(
    array( 
        'region' => $client_options['region'],
        'version' => 'latest',
        'credentials' => $credentials, 
    )
);

And its working correctly. Apparently they implement the factory on the CloudFrontClient in v3 and not on the s3 client. Would also be handy to have some wp2static logging when the crawl, process, and invalidation jobs end ie Invalidating CloudFront Complete Invalidating all CloudFront Items

john-shaffer commented 4 years ago

@sgerlach reported that the CallerReference must be unique each time (see https://docs.aws.amazon.com/cli/latest/reference/cloudfront/create-invalidation.html). This should be fixed at the same time. I'd like to look into this at some point and find a more efficient solution than invalidating the entire cache, as that can get very costly very quickly.

leonstafford commented 4 years ago

previously fixed