作者名:Davy Mitchell Sergey Akopkokhyants Ivo Balbaert
本章字數:138字
更新時間:2021-07-09 18:56:24
Static generation
Web hosting facilities vary greatly from provider to provider. The ability to run programs and install software is not universally available. Static generation of websites has become more popular with the ability to run small simple virtual machines on the cloud.
The advantages are very clear, there is not maintenance on software or a database to maintain, making the system very secure and also very fast to serve. It is not suitable for all applications, though. Blogging is one where static generation may make sense.
Freezing the website
In this chapter's project, there is a staticgen.dart file in the bin folder. This is a standalone program that generates a static HTML file of the front page of the blog. Note that the main function is marked with the async keyword and is missing the void keyword.