What Is Gatsby? Is It a WordPress Competitor?
What is Gatsby?
The simplest answer to the “what is Gatsby” question is this: Gatsby (aka. GatsbyJS) is a static site generator that is built on ReactJS.
In its simplest definition, a static website is a group of HTML pages, which does not pull any data from a database when a viewer visits it. Thus, a static site looks the same for every visitor. Static sites are faster to load too, as the server sends the same response to every visitor. However, you can not customize content for visitors.
On the other hand, a website hosted with WordPress is dynamic, meaning that the content showed is dependent on the visitor. The server analyses each request and decides how to respond.
?? The idea of a “static WordPress website” is something we explored in one of the previous posts on this blog – aka. headless WordPress. Gatsby is another technology that makes static WordPress or a static alternative to WordPress possible.
Gatsby’s pros and cons
There are certain advantages to using Gatsby, which may appeal to potential users. A site built with Gatsby is essentially a single page application. This means that clicking on an internal link doesn’t create the need to load a completely new resource, which in turn saves a lot of HTTP requests. In WordPress, you need to follow certain best practices to make sure your site is optimized for speed, or that your images are optimized as well.
In Gatsby, for instance, image optimization is automatic. For starters, Gatsby removes all metadata from images, resizes and compresses them, and also implements lazy loading! In WordPress, we suggest using a service like Optimole for image optimization.
Further, Gatsby also does other tasks like bundling and minification of resources in your website before serving them. Finally, as the website is static, any update reflects in the production version as soon as a push arrives.
Overall, static sites are also more secure since there’s essentially nowhere a hacker can break into – apart from breaking the server itself. With WordPress, everyone gets access to what’s basically raw PHP files that can be vulnerable to multiple different attacks. With many WordPress sites using more than 20 plugins at the same time, there’s a reasonable chance one of those plugins will be exploited and used as a gateway to break into your site. Like it happened not that long ago with the P3 plugin.
Gatsby vs WordPress
At this point, we can all understand the core differences between Gatsby and WordPress – one being a static website generator and the other being a fully-fledged dynamic website engine and CMS, but let’s have a deeper look into individual aspects of each:
The ease of creating a new site with Gatsby vs WordPress
As compared to WordPress, I would say that installing Gatsby requires a similar level of skill. In WordPress, you need a web server (Apache), PHP, and a database installed before you can get around to installing WordPress.
This is especially valid if we’re discussing installing WordPress for development purposes – meaning that you’ll most likely need to install WordPress by hand, and not take advantage of your web host’s ready-made WordPress installation.
The ease of creating a blank site with Gatsby vs WordPress
In terms of what Gatsby is, as compared to WordPress, creating a blank site with Gatsby is a bit more difficult, as it involves using the terminal.
In WordPress, you have a nice installation wizard that gets you through the steps nicely, and the only thing you have to do by hand is to prepare a database.
How do Gatsby themes compare to WordPress’?
Given the maturity of the WordPress project, there is a huge collection of WordPress themes to choose from. If you switch to Gatsby, your options are very limited, unless you want to develop a theme from scratch.
Not to mention, installing and switching themes in WordPress is super simple, and customizing them isn’t that much more difficult either, even if you have absolutely zero programming knowledge.
Overall, in the theme department, it’s a no-contest. WordPress dominates.