20 July 2021
Sounds fun, isn’t it?
What is a static site?
A static site serves the content straight to the user as it is stored on the server-side. To put it in another way, in opposition to WordPress which use a database to load dynamic content, a static site will display the same content to every user as it will directly load the HTML files on the server.
A static site serves the content straight to the user as it is stored on the server-side. In opposition to WordPress, which uses a database to load dynamic content, a static site will display the same content to every user as it will directly load the HTML files on the server.
In the last few years, static sites have greatly increased in popularity. This surge is primarily due to advances in developer tools (languages and libraries) and a stronger desire among businesses to optimize website performance beyond the limits of a database-driven site.
A dynamic website uses a database and PHP/MySQL to generate the content of a page when a user requests it. For example, building a website using WordPress CMS will result in having a dynamic Website.
Why use a static site?
What are the advantages of a static website over a dynamic site? You may be wondering Why should I build a static site when I could do the same by using WordPress?. Well, having a database implies a lot of downsides. Here come the main advantages of using a static site over a dynamic one.
The better performance and a crazy fast load time. One of the main advantages of using a static site is the fact that it is crazy fast to load. Indeed, when the user requests a page, there is no need to request a database and various files to generate the page itself as all the content is already placed in a one and only file: an HTML one. That’s why by using a static site, you will get a boost in your loading time that will provide a great user experience for the internauts. Moreover, we know that more and more people are surfing the web using their smartphones with, sometimes, poor internet connections. That’s why having fast loading times will participate in making your website mobile-friendly.
Having a static website: say goodbye to hacking and security issues. Are you tired of getting WordPress notifications about security issues and updates every week? No worries, as a static site has no database, there are close to no hack possible compared to a WordPress website. Indeed, your site will have way fewer footprints and security issues since it will only load plain HTML and CSS files. The security gain in having a static website is one of the main reasons why many famous brands switch to a static site instead of having their website on Drupal or WordPress.
Building a static site and hosting: you will save you money. Using a static site, you will only have most of the time only HTML and CSS files to host. This kind of file is super light which also means that you will not need a powerhouse hosting to have a static site up and running. Moreover, if your traffic suddenly increases, your site will not go down, contrary to a dynamic site that should request the database each time for each user.
You’re the master. You were using a CMS means, giving control over your site to others. Simple like this.
Why use a site generator?
Working with pure HTML files is annoying; senseless today. Indeed, if you need to make a modification on your self-managed pages, you have to manually change every file. That’s monkey’s work from the early days of static websites. If your site comes with ten pages, it can be manageable but imagine if your site is providing 100+ pages or the blog planned for hundreds of articles?
Using a static site generator will solve this issue as it separates the content and the Template. To say it another way, by using a static site generator, you will only need to make the modification once, and the generator will apply it to all your pages.
As the popularity of static sites is growing, there are plenty of static site generators available on the market. The more famous is Jekyll, Middleman and Hugo. Each one has its own specificities and may suits you better depending on the programming languages you already are familiar with. Which static site generator should I use?
When I decided to go for a blog based on a static web, I personally choose Jekyll as for me. It’s a well-known static site generator, good support in case of trouble, and the software gets regularly updated. This website is powered by Jekyll. For good reasons.