I deploy a single-page application website by pushing assets to AWS S3 and serving the files through CloudFront. As per this answer, it isn't possible for me to serve files directly from S3 using SSL under my own domain, so I don't have a choice about using CloudFront if I want to serve files in this way.
When I redeploy, I generate a new timestamped, root HTML file (which itself links to the updated JS and CSS bundles), push it to S3 along with everything else, and then make that new file the new Default Root Object for the CloudFront distribution via the AWS. This prevents CloudFront from caching everything and hiding the updates.
The problem is that, occasionally, CloudFront takes a long time to update the root object. As I write this, I'm tabbing over hitting refresh every 60 seconds waiting for an important change to hit production. CloudFront shows the correct (newest) root object via the web console but it also shows "Status: In Progress."
At times, this delay is barely noticeable, and other times it's quite long. Today it is approaching an hour delay.
How can I avoid this? I'm open to both changes to this deployment method using S3 and CloudFront OR switching to an alternative platform that is known to handle this use case better.