Migrating This Site Away From Gatsby

Well it's happened again. I've done yet another rebuild of this website using Django and Wagtail. For my previous build, I used Gatsby to build a static site which I hosted on Netlify. The dynamic content of the site was stored in an instance of Ghost which was then pulled in at build-time.

Overall, I was quite disappointed with Gatsby. I found the framework to be quite over-engineered. At one point, I found myself trying to resize a photo or something and it required some (to me at least) very complex configuration and some fancy graphQL query just to get the image to load. Another issue I have is with the offline plugin. Gatsby uses service workers to cache your entire site offline which can then be served by a service worker in case your users have spotty internet. Or no internet. The problem comes with removing this service worker once you move away from the framework. I needed to do quite a bit of research to figure out how to delete the service worker once I moved over to the new site since Gatsby chooses to use caching very aggressively which is not recommended.

I understand why Gatsby makes these choices. Their goal is to make websites load insanely fast which I think they accomplish at a great cost of complexity. And they work hard to ensure that Gatsby sites score highly on the Google Lighthouse test. I have two issues with these goals. First, I'm not sure pursuing a high score on Lighthouse is a good goal to optimize for. Making a website load quickly is important, but Lighthouse will ding you for things using a particular Javascript library instead of their recommended smaller library. This is a game of cat-and-mouse which has little benefit beyond speeding up your website (which is important). Second, the amount of complexity that Gatsby introduces will likely slow down the development of your site and stifle your creativity. I can't comment on the experience of using Gatsby in the context of a larger team, but for me I know it led to making fewer improvements to the site because of the complexity.

As for Ghost as a headless CMS – I think there are some limitations there. Overall, Ghost is a great platform. It's reliable and usable and has a good writing experience. I do think that their push into the JAMStack fad was mostly a marketing play since some limitations were never addressed even after several years. I would definitely use Ghost again, just not as a headless CMS. I would use it how it was primarily designed to be used.

So why did I choose Django and Wagtail? Well, I've been using Django on and off for a long time. Probably 7 years at this point. The framework is reliable and seriously productive. Wagtail is built as a Django "app" so it's very familiar to me and it's very powerful. Overall, I'm content with the developer experience so far. I think the admin interface that is used to publish content could use some work. It's functional but frankly it's pretty ugly. Especially compared to something like Statamic which has been getting some attention lately.

It's been a while since I've run my blog with server-rendered pages with dynamic content as opposed to a static site published to a CDN. I think the fact that I can log into a dashboard and publish content is so much more ergonomic from a writing and publishing perspective that I'm more likely to write more. Compared to the process of building a static site and deploying an update, it's quite nice. The downside, obviously, is that I need to worry again about load on the site and downtime during traffic spikes. I'm hopeful that this is something that I can avoid by using caching and a CDN. The site now has virtually no javascript. Compared to Gatsby this is a big change. We'll see how it turns out but my theory is that I should be able to achieve similar speeds (good enough anyway) using some clever caching and a CDN. Browsers are pretty good at rendering plain HTML after all.