How to upload pre-rendered file on S3 and access that on initial load of our webpage?

Question:

I have my web application implemented using Angular Universal Starter kit. I want to upload the pre-rendered file to the S3 bucket so that my initial page gets loaded faster.But I couldn’t find the proper configurations regarding uploading the pre-rendered file to S3 and how to access that file on initial load?

Answer:

Using a prerendered HTML is the same as uploading a static website. Assuming that you have aws cli installed and configured (using aws configure), you can run the following command on the directory to upload the file to a s3 bucket.

This will only upload/update those files which have changed from the
existing bucket files.

Additionally, if you want to set cache then you can add the following option

Leave a Reply