我有一些关于在云端部署React应用程序的问题。
如何缓存和更新托管在Cloud front上的前端网站?
When I upload a new files to the bucket I will see the changes IMEDIATELY after accessing the site again? If not, how long it will take?
I need to make an invalidate request to see the changes working on the website? If yes, how long it will take?在Cloud Front中处理单页应用的缓存和更新的最佳方法是什么?(我正在使用React应用程序和Webpack)
发布于 2018-08-24 08:30:32
您需要做的是清除存储桶的缓存或使文件“无效”。
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html
因此,安装aws cli并运行以下命令:
aws cloudfront create-invalidation --distribution-id $CDN_DISTRIBUTION_ID --paths "/*"
我建议您使用您的S3存储桶进行开发。
https://stackoverflow.com/questions/51995890
复制相似问题