简体   繁体   中英

Deploying new versions of Angular App to AWS S3

I currently have an Angular APP deployed to AWS S3/Cloudfront and everything is working fine.

However, I want to know what is the best process to follow in order to deploy a new version of the App without interfering with the old one (users currently using the app should still be able to use it fine).

Currently, if I deploy a new version, users might get errors loading angular's chunks from modules and etc. Only fixed by refreshing the app, which is not nice).

Looked everywhere for this but could't find a recommended approach.

Thanks

If you are using CloudFront:

  1. Upload your code
  2. Invalidate cache in cloudfront

Step to invalidate cache forcefully:

  1. Select the distribution for which you want to invalidate files.

    Choose Distribution Settings.

    Choose the Invalidations tab.

    Choose Create Invalidation.

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html For the files that you want to invalidate, enter one invalidation path per line. For information about specifying invalidation paths, see Specifying the Files to Invalidate.

https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-serving-outdated-content-s3/

Another way to user versioning in content like js/css/images etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM