you can have invalidation requests for up to 3,000 files per distribution in progress at one time.
If this number is exceeded, the invalidation requests will fail. The invalidateCache method accepts an array of paths, but does not presently batch the invalidation requests if greater than 3000 paths are provided. To work around this limitation, invalidation requests should be sent in 3000-chunk batches.
It should also be noted that invalidation requests may be in progress for a non-trivial duration; if multiple 3000-chunk invalidation requests are sent simultaneously, only the first batch will succeed — the others will fail. I believe the only way to avoid this situation is to send these invalidation requests synchronously.
Per the CloudFront API documentation,
If this number is exceeded, the invalidation requests will fail. The
invalidateCache
method accepts an array of paths, but does not presently batch the invalidation requests if greater than 3000 paths are provided. To work around this limitation, invalidation requests should be sent in 3000-chunk batches.It should also be noted that invalidation requests may be in progress for a non-trivial duration; if multiple 3000-chunk invalidation requests are sent simultaneously, only the first batch will succeed — the others will fail. I believe the only way to avoid this situation is to send these invalidation requests synchronously.