Should you go static for your next web project?

Static site hosting is free on Kinsta!

·

4 min read

Should you go static for your next web project?

When the “World Wide Web” was first revealed to the public in 1991, all websites were collections of static HTML documents. These were "static" because they didn't change unless someone manually updated them.

Soon, developers began to create more dynamic, interactive sites using databases and special server code. But those original, static sites never went away. In fact, they're making a comeback for their speed and security advantages.

What Are Static Websites?

To explain how static websites work, first, we have to understand how dynamic website works.

Every time we visit a website, the server has to parse PHP files, query the database to fetch the data, and, in the end, return the rendered HTML to the browser.

Static websites do all the heavy lifting first – before visiting the website, we save every page as static HTML. When we visit the desired page, the server serves it as it is.

What kind of projects can be deployed as static sites?

“If you have no pages that require someone to log in, no database or anything else that would require dynamic content, then it’s probably a good candidate to be a static site,” Fuller says. “This can include things such as portfolios, marketing pages, or even a blog if you’re happy writing new posts using a static site generator.”

And when a site doesn’t have a server or database to connect to, it offers fewer pathways for security breaches.

“For more advanced cases, you can have a mixed approach,” Fuller says. “You can create a static site that uses a JavaScript framework to talk to a server managed separately. This way, you get the speed benefits in your initial load times, combined with the flexibility of a dynamic site.”

The Pros of Going Static

“The advantage of having static content is that it’s fast and efficient,” says Michael Fuller, a JavaScript developer at Kinsta and a member of the team that helped launch Kinsta’s Static Site Hosting platform. “Rather than a server having to construct the page by talking to the database, it just sends users your pre-made files.”

“Instead of hand-crafting static files entirely, there are a number of static site generators,” he says. “These are kits that help make the creation and update process of a static site easier by turning the files you provide into a working website.”

Speed and Performance

Static websites are quick and performant. Why? Because they are just static HTML. This means the server must do only one thing – serve the website. It doesn’t have to parse anything or wait for data from the database.

Also, static websites are easier to host on CDNs (although Edge Cache works similarly), which places all the files as near you as possible.

Overall – static websites perform amazingly under heavy traffic.

Security

WordPress’ core is secure – it really is. But the plugins and themes – not always. Also, everyone can try to start guessing our login and password.

Overall, I like to compare WordPress with a house with many doors and windows. It’s up to us to choose the most secure ones, but still, if one door isn’t safe enough, a hacker can hack our website.

Converting your website to static removes most attack vectors. Because it’s just HTML, a hacker won’t be able to use vulnerable plugins or benefit from a weak password.

Peace of Mind

A typical WordPress setup consists of many moving parts – PHP and database servers, themes, or plugins – and every part can break. With static, we remove most of them. Our server becomes more straightforward as it only serves HTML and our content is spread worldwide thanks to CDN, which makes it DDoS-protected.

As a result, the probability that something will break is much smaller than usual.

The Cons of Converting to Static

Workarounds

We are used to things like searching the website, adding comments, or sending forms to work out of the box with WordPress. With static, it’s not that simple anymore. Because we converted everything to HTML, we lost those possibilities.

We have to use some 3rd party tools to add this functionality back.

Build process

We are used to the new content being available on our website after pressing the publish button. With the static approach, we must convert our website whenever we want to update it. So it can take a few minutes between pressing the button and having it available for everyone.

Static Site Hosting is FREE at Kinsta

Here’s what you get for free on Kinsta’s Static Site Hosting platform:

  • 100 static sites per company

  • 1 concurrent build per site

  • 1 GB build image size per site

  • 600 build minutes per month per company

  • 100 GB bandwidth per month per company

And, as with Kinsta’s Application Hosting and Managed WordPress Hosting platforms, there are free SSL certificates, support for custom domain names, and an optional API for site management.

Kinsta builds and pushes static site content to the 260+ data centers in the Cloudflare global network — the same platform that backs the Kinsta CDN and edge caching for WordPress sites.