Lwin Maung Maung

My Notes and Blogs

Home Laravel Linux
<-

NextJS to Drupal - The rollback of blogging

Published on  Apr 13th, 2024Updated:  May 3rd, 2024
2 mins Read

Rolling back from NextJS to Drupal is never easy, but I have done it this month.

I have set up a website in Drupal backend and NextJS frontend. That means Drupal serves the content, and NextJS display it. I have to roll back from NextJS to Drupal for the main reason.

Why Decoupled CMS than WordPress or Drupal?

I don't know if my setup is good; I set the content part, and the presentation part makes me two parts. I don't want to build the blogging part, so I use Drupal. It serves the content, and NextJS works as a presentation.

The website testing went well. However, from time to time, the results show that the responses are not as great as I think.

To serve a fast website - the system has to face two things: server bootup and network bootup.

Server bootup can tune up by config and speed up caching, etc. It is all under control.

The thing under lesser control is the client machine network bootup. Your machine will cache tons of DNS records, browser caches and speed-ups because your machine works daily with this website.

The client machines do not have any of them. They will search for a topic from search engines, your SEO-tuned title works on the first page, and they reach your website without knowing anything. Such a kind of visit is what we call the cold boot.

The cold boot cannot handle everything. The client browser has nothing to cache. It also looked for the DNS cache and found nothing. The browser has to call everything from associated servers for small content.

We need to load faster on the first boot because other pages have stored some caches in the client browser.

NextJS failed to support this event. It has to serve a lot of files as chunks. This event makes the website load slower on cold boot. Caching does not help because the cache only stores the text, and the CDN serves the images.

Finally, I have to remove old pages and come back to Drupal. I like NextJS, and the blog you read now is still working in NextJS. However, it is not the bulletproof solution to everything.

In NextJS, my website boots in 2.3s, but now it is 800ms (0.8s) cold boot on Drupal.

© lwinmaungmaung MMXXIII. All Rights Reserved.