官术网_书友最值得收藏!

Static websites

Let's see the following few examples of static websites:

  • Company website
  • Portfolio
  • Blog
  • Online documentation

Static hosting is the simplest and oldest kind of serverless hosting. A static website, by definition, doesn't require server-side logic. You just need to map your site URLs to HTML files. In this book, we are going to use Amazon S3 to distribute HTML, CSS, JavaScript, and image files. Using Amazon Route 53, you give AWS the rights to route all domain requests to an S3 bucket that acts like a simple and cheap filesystem.

Hosting static files on a storage system is by far the best solution. It's cheap, fast, scalable, and highly available. There is no drawback. There is no function with cold start, no debugging, no uncertainties, and changing vendors is an easy task.

If you are thinking of using WordPress to build a static site, please reconsider. You would need to spin up a server to launch a web server and a database that stores data. You start paying a few dollars per month to host a basic site and that cost greatly increases with your audience. For availability, you would add another machine and a load balance, and the billing would cost at least dozens of dollars per month. Also, as WordPress is so largely used, it's a big target for hackers and you will end up worrying about periodic security patches for WordPress and its plugins.

So, how should you build a static site with a serverless approach? Nowadays, there are dozens of tools. I personally recommend Jekyll. You can host on GitHub pages for free, use Disqus to handle blog comments, and easily find many other plugins and templates. For my personal blog, I prefer to use Amazon because of its reliability and I pay just a few cents per month. If you want, you can also add CloudFront, which is a Content Delivery Network (CDN), to reduce latency by approximating users to your site files.

主站蜘蛛池模板: 合肥市| 利津县| 舞阳县| 正宁县| 靖边县| 于田县| 孟津县| 文水县| 麦盖提县| 池州市| 察哈| 木兰县| 古交市| 封开县| 四子王旗| 仲巴县| 广宁县| 华亭县| 凤阳县| 眉山市| 阿拉善右旗| 凌海市| 诏安县| 阿克苏市| 象山县| 赤壁市| 乌鲁木齐市| 六安市| 东宁县| 长海县| 吴桥县| 万年县| 项城市| 伊川县| 锡林郭勒盟| 苗栗市| 新巴尔虎左旗| 高安市| 青州市| 社会| 吉木萨尔县|