Single Page App + Amazon S3 + Amazon CloudFront + Prerender.io - how to set up?

后端 未结 5 1262
清歌不尽
清歌不尽 2021-02-07 09:15
  1. I have single page app built with Backbone.js.
  2. I host app (app consists of static files only) on Amazon S3.
  3. I use CloudFront as a Bucket CDN.
  4. Ap
5条回答
  •  长发绾君心
    2021-02-07 09:56

    It's hard to use Prerender.io with a static Amazon S3 site.

    You could stand up an nginx/apache server in front of s3: https://myapp.com -> https://mynginx-server.com -> https://myBucket.s3-eu-west-1.amazonaws.com/index.html

    This solution is less ideal because you lose the closest-location benefit of cloudfront.

    This is a good article about a custom solution: http://www.dave.cx/post/23/prerendering-angular-s3/

    David was able to generate the static HTML and save them in S3, then use CloudFlare to detect _escaped_fragment_ in the URL and redirect it to the static HTML on S3.

提交回复
热议问题