HobojoeBr
HobojoeBr

Reputation: 619

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

Upvotes: 1

Views: 539

Answers (1)

Avinash Dalvi
Avinash Dalvi

Reputation: 9301

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.

Upvotes: 1

Related Questions