DEV Community

Cover image for Static Site Generators - the WordPress alternative no one's talking about

Static Site Generators - the WordPress alternative no one's talking about

darrendube on March 28, 2021

We've all experienced it. Websites suddenly becoming slow for no reason, loading times in the double digits, or even the dreaded "Error establishi...
Collapse
 
grahamthedev profile image
GrahamTheDev

I am confused, did I miss the part where you simply cache pages on WordPress so you don’t hit the database?

I mean they even make the plugins for page caching “non tech” friendly, unlike SSGs.

I mean that is the whole argument for a static site generator presented here, that you are serving static files?

Other than cost, which is a valid reason for micro sites, distribution to CDNs and not needing a database are the big winds for SSG surely?

Don’t get me wrong I am not a fan of WordPress but I have seen it run sites that have thousands of visitors on modest hardware.

Wordpress sites are slow due to crappy plugin choices, bloated themes etc. It is not WP itself that is slow and trust me I have seen enough sites on SSG be slow as well as the front end tends to be the bottleneck.

Collapse
 
darrendube profile image
darrendube

Yeah, but I sort of feel that caching is like dealing with the symptoms of the problem instead of the underlying problem (if that makes sense). I do agree with the fact that SSGs are not for everyone, but developers might work better with them than WordPress

Collapse
 
moopet profile image
Ben Sinclair

A static site generator is literally a site like wordpress but with an extra build step. Wordpress + caching takes that build step away.

Thread Thread
 
jdforsythe profile image
Jeremy Forsythe

If you ignore all the problems with WordPress, then yeah.

Collapse
 
jdforsythe profile image
Jeremy Forsythe

The problem is that a major cache plug-in for WP just released an update with a bug that broke caching in an impossible to debug manner. This just isn't an issue with SSGs. Plus there are plugin vulnerabilities, etc.

Collapse
 
grahamthedev profile image
GrahamTheDev

That still isn't a WordPress problem as per my first answer.

It is a plugin problem and SSGs will suffer a similar fate with broken plugins as they gain popularity and people with less experience start developing with them.

As for plugin vulnerabilities, SSGs use plugins too and most are served via something like npm (which can be an additional vulnerability as people just blindly trust packages).

Yet again I would stress I am not a fan of WordPress but none of the issues are an issue with WordPress itself and SSGs are far from immune, they are just not widely used enough to justify the effort of attacking them (yet).

Thread Thread
 
jdforsythe profile image
Jeremy Forsythe

I understand what you're saying, and WP isn't inherently bad.

There is something different about the dependencies, though. WP plug-ins are code running on your production server. That is inherently more dangerous (to my server) than an npm script that runs in the browser, or a plugin that emits static HTML code that I upload to S3. The npm script can't bork my production DB and take down my site because there isn't a production DB (speaking strictly about page/article content).

Thread Thread
 
grahamthedev profile image
GrahamTheDev • Edited

All valid points and I am playing devils advocate in all of this as I actually like SSGs, I am in the middle of working on a hybrid system as we speak.

Just sticking up for poor old WordPress (poor thing with its dominant market share 😂😂).

Thread Thread
 
jdforsythe profile image
Jeremy Forsythe

I just made a bunch of arguments against WP to the marketing department and inadvertently made a new project for my team to redo the site with an SSG. Maybe I'll tell them you said it's not so bad 🤣🤣

Collapse
 
mathieuhuot profile image
Mathieu Huot • Edited

I hear you on that. Jamstack is missing the great user experience that WordPress enjoy in exange for developer's experience. Headless CMSs are closing the gap, but there's still a big gap there. Especially in regards of dynamic data rendering. On the other hand, I sees amazing possibilities from decoupling the front-end from the data/API. This is where I'm investing and I feel there is so much that remains to be seen in that area.

Collapse
 
phlash profile image
Phil Ashby

I chose to move from Wordpress to SSG (using two CMS approaches: NetlifyCMS or raw Markdown in git for my own site; offline Wordpress and an SSG plugin for a friend who likes WP), primarily for: cost reduction - CDN hosting is massively (1000+ times) cheaper than a VM; security posture improvement (a cloud company problem, not mine now); lower operational hassle (no more patching, DB backups, etc.)

Collapse
 
djuric profile image
Žarko Đurić

How would you cache a shopping cart website with many pages and components changing all the time?

Collapse
 
grahamthedev profile image
GrahamTheDev • Edited

And how would you manage the same with a SSG?

There are fragment caches, object caches, partial page caches etc.

Thread Thread
 
djuric profile image
Žarko Đurić

SSG doesn't need caching. WordPress plugins like WP Super Cache would generate static HTML files but those are basically just snapshots of dynamic WP pages. It's very difficult to manage that if your site is dynamic. You would need to re-generate those snapshots quite often

Thread Thread
 
djuric profile image
Žarko Đurić

Yeah it's true you could achieve that with something like fragment caches. But honestly it seems to be a lot of work and I'm not sure if it's worth it. As someone said above it's dealing with the symptoms of the problem instead of the actual problem

Collapse
 
lionelrowe profile image
lionel-rowe

"No-one" is talking about one of the biggest and most mainstream trends in web development over the last several years?

Collapse
 
aminmansuri profile image
hidden_dude

Funny because static site generation was the first big trend on the web back in the mid 90s.

It was abandoned for more complex stuff and because of improving code stacks. But it's still a very valid strategy where it can work and for very heavily hit sites.

You can even make it work with comment sections. (Slashdot for the longest time statically generated their site)

What you do is take in comments, but don't show them till some time passes and your site is regenerated. The advantage of that approach is that the site is always up, and site generation is independent of current load.. if it takes longer.. oh well.. so be it.. but the site is still up).

Collapse
 
maciekgrzybek profile image
Maciek Grzybek

My exact same thought 😂

Collapse
 
darrendube profile image
darrendube

😂😂I'll be more careful with my titles next time

Collapse
 
lucagrandicelli profile image
Luca

Bringin' to attention SSGs for those who're not familiar yet is a good point and above all, a good matter to talk about. But i would not probably say that SSGs are a WordPress alternative, for many reasons. One above all: they're not comparable because are not the same thing.

Then a bunch of other reasons that come quickly in my mind:

  1. SSGs are cool because they're fast but miss the elephant in the room: CMS.
  2. Wordpress is gonna be an outdated technology very soon, unless they refactor the entire event-driven code and, most importantly, the DB structure. However, WordPress runs smootly; its plugins not, which are the most important problem of the WP ecosystem.
  3. I worked many years for several companies that managed high-traffic WordPress websites and owned an entire editorial network. I cannot imagine the hundreds of journalists using a Markdown editor. I don't, really.
  4. WordPress Caching is a thing and real. And it works.

Headless CMS + SSGs are the key, however.

Collapse
 
rcls profile image
OssiDev

React: Gatsby, Next.js
Vue.js: Nuxs.js

Used all of those frameworks for SSG with Wordpress, Contentful or Strapi as a back-end. It's totally worth learning.

Collapse
 
crimsonmed profile image
Médéric Burlet

Ive configured wordpress websites to load in less than a second with assets it is easy to tweak there are even plugins who help you do auto minify and file concatanation. Database connection also comes from poorly designed network if you make sure your database is on same server or same country you wont get that issue unless you host is down but then that would also be an issue for static websites.

Then lets talk plugins wordpress being there and established for so long you have huge plugins like WooCommerce that let you start e-commerce websites very easily and configure everything in real time.

And I disagree a lot of people are using static site generator but usually for portfolios and more. Also take time into consideration. If im someone not tech savy and just want a small website for my business with Wordpress you signup, configure and in 5 minutes you are up and running.

They target different audience and different needs.

Collapse
 
ashv profile image
Ashish Vishwakarma

Let me tell you my story of SSG, I have chosen Jekyll with GitHub pages 3 years back. I used to write Markdown in my local machine, then used to push code to GitHub pages. Then sometimes, I wanted to write a blog post but I wasn't on my development machine. Now I use some Static CMS to tackle this.

Conclusion is, SSG softwares aren't popular because they are currently targetted to developers only.

Collapse
 
_hs_ profile image
HS

It's good to list simple ones. And then there's this one github.com/sake92/hepek. I like going a bit outside of popular and try to research really unknown. But to be honest in this case it's a friend who started it. Cool thing in here for me is that it's mostly developer oriented so you I guess it might be easier then learning some markup language or so.

Collapse
 
axju profile image
axju

Really nice post. I also setup my blog with a static page generator. I use Pelican, because I like Python. In my last post I explain how I publish it with Jenkins.

Collapse
 
fr0tt profile image
fr0tt

I think the headline is misleading.
I'm not a big fan of Wordpress to be honest but it serves a completely different purpose and is a completely different tool. SSGs can be used to create websites for yourself as a developer, for other developers (and can be hosted on a platform like GitHub so others can easily contribute) or in combination with a CMS. A CMS on the other hand can be used for and sometimes even from non-technical folks like clients and you host them easily on shared hosting.

Collapse
 
zacharysarette profile image
Zach

Have you ever made a site with Hugo?

Collapse
 
darrendube profile image
darrendube

No, I've only used GatsbyJS.

Collapse
 
zacharysarette profile image
Zach

I don't think you need to know Go to use Hugo.

Thread Thread
 
phlash profile image
Phil Ashby

My personal site is built with Hugo, you do need to learn their Markdown extension syntax if you want useful things like automatic linking between pages, or writing your own macros.. but you definitely don't need any Go skills.

Collapse
 
grocker42 profile image
Grocker • Edited

If tailwind css is a option primo.af is a nice static site generator cms.

Collapse
 
youhan profile image
Alireza Jahandideh

Go Gridsome. Use Wordpress for content management (if you reeaaly have to) and publish static website!

Collapse
 
stremovsky profile image
Yuli • Edited

I am using hugo for:

  1. databunker.org/
  2. privacybunker.io/
  3. basebunker.com/

I like it very much! Kudos to the Development Team!

Collapse
 
epsi profile image
E.R. Nurwijayadi
Collapse
 
b4rtaz profile image
b4rtaz

I recommend t3mpl.n4no.com/ It's similar to Jekyll, but it needs only browser (or CLI).

Collapse
 
abhinavs profile image
Abhinav Saxena

I recently wrote a post on the similar topic - abhinav.co/static-websites

Collapse
 
arvindpdmn profile image
Arvind Padmanabhan

Another source to know more about static site generators: devopedia.org/static-site-generators

Collapse
 
bitardev profile image
BITAR Youssef

Nice Article, very helpful, Keep going !