It's been a year since this blog site was built! So it's a great opportunity to reflect on my personal thoughts about building a blog after a year. I've also made a few small adjustments to the blog's deployment, which I can share with everyone, haha.
Review#
Looking back at the article I wrote last year, I still feel quite touched:
...
What can a Blog bring us#
- Personal Brand: This is most evident on a technical level. Most tech leaders have their own blog sites, where they record and share many high-quality analyses and conclusions. Just browsing through the blog list can yield a lot of insights.
- Low Barrier to Entry for Writing: Here, I mainly think about the threshold for the quality of content I write. On most existing social platforms, sharing various articles often requires repeated modifications and processing of the content. Many ideas I want to share feel unworthy of writing after going through this invisible cost, and those fleeting sparks might just extinguish, which is a bit of a pity.
- Freedom
- Product Practice: I believe many of you have suggested optimizations for the reading experience on certain platforms more than once. This color scheme doesn't work, that ad is annoying, this ecosystem is closed, that review is strict. A blog provides a relatively free canvas to realize some of your ideas. For products, a personal blog is a small product that can encompass all your thoughts on this form of content carrier. Though small, it has everything.
- Technical Implementation: For programmers, self-hosting a site is the best entry point for technical practice. If you want, a blog almost contains all the technical scenarios and stacks you can try, making it a great training ground.
...
After a year, I have some new thoughts on the above points, especially regarding personal branding and writing thresholds:
Personal Brand#
I realized this point when I saw a Feishu document this year. It's really useful for meeting new friends.
💡 Tao Chenyu's Personal Manual provides a very detailed introduction to her personal information. It feels like you can quickly understand a friend through the document, which is quite nice. However, it seems this version has removed a lot of self-introduction, perhaps because too many people want to get to know her, haha.
Actually, many times when you introduce yourself, different friends have very different levels of acceptance for this information. It's possible that when you introduce yourself, interested friends feel you said too little and are left wanting more, but they don't know how to get to the points they're interested in. This can be quite awkward, and new friends might think you're a bit introverted and have no hobbies, which could lead to missing the opportunity to meet like-minded friends.
The opposite is also true. If new friends aren't very interested in getting to know you, and you ramble on, it's likely they won't get it either, and it might just be—saying more would be impolite. This can easily lead you to think your introduction is meaningless, affecting your ability to meet new friends later, which is also quite awkward, haha.
Getting to know someone through a blog or article is actually a slow-paced asynchronous social method. In today's society, everyone has their own rhythm and way of processing information. So when you introduce yourself and pull out your blog, that will be a killer move, haha (see my about page here).
So this year, when meeting new friends, I also tried this method and found it quite good, haha.
Low Barrier to Writing Costs#
This really has an impact, one being the resistance to writing and the other being the pressure to publish.
The resistance feels like it's still in a waiting-for-the-right-time phase, and I don't have a good method to overcome it, haha. I still need to learn a bit.
However, writing a blog significantly reduces the pressure to publish. For example, my COVID-19 Record feels inappropriate to post on general platforms, but on my own blog, it's different and more casual. Writing on my blog feels like having friends over to my house, which makes me more relaxed; whereas writing on a platform feels like going to someone else's house, which makes me more reserved, haha.
But this article will be something I want to look back on years later, and it will surely help friends who are interested in it. If I didn't have a blog, I might have lost these memorable moments in my life, which would be a pity.
Insights#
Buy Yourself a Few More Baskets to Hold Things#
There's a theory that says: if you have a hammer in hand, everything looks like a nail.
However, from my experience of writing a blog for a year, this theory might have a second half in some cases: But in most cases, if you don't have a hammer, you won't even see the nails.
The human brain actually uses a very energy-efficient algorithm. When faced with things you don't need to understand, the brain will place that information at the end of the priority queue. If you don't have the energy to process it, it will be discarded. But if you have a hammer in hand, that priority increases, and you might notice things. For example, the classic Pregnancy Effect (the more you focus on something, the more it appears).
Over the past year of blogging, I've discovered many excellent blog sites. In previous visits, I might have entered through searching for technical issues, read the problem, and left. But as I thought more about my own blog, I also absorbed more information from others' blogs.
For example, I slowly began to pay attention to various details of these blogs, starting to appreciate the layout of the entire site from a design perspective, whether the UI design is advanced, clear, and beautiful, whether the clickable content and links are redundant, whether there are ways to contact the blogger on the about page, how the overall site loads and displays, and what the corresponding tech stack is; how the site's traffic is, and how much traffic each article receives, etc.
For example, the open-source xlog by diygod, see https://diygod.cc.
Similarly, at work, while tinkering with my blog, I began to consider what technologies to use to meet my needs at a low cost. I started to pay attention to some operational technologies at work, such as Nginx configuration, Docker deployment, DNS resolution, and CDN acceleration. From previously just needing it to work, I gradually moved to looking at how to optimize it.
So, I expanded this idea into the Basket Theory (just making it up, haha): In life, when we go out, we should take a few more baskets to hold things. Useful tools like hammers should be collected more, allowing us to discover more "nails" in life.
I learn, haha.
The Necessity of Saving Money on Infrastructure#
Initially, I thought it would be fine to use free deployment platforms for the blog, so I didn't consider other performance optimization measures. However, after the usage scenarios increased, I found that optimizing really costs money everywhere: OSS costs money, CDN costs money, cloud servers cost money, bandwidth costs money. Although I used to apply for a budget for work, the experience is different when that budget is actually taken from your own wallet, haha.
I remember when I was working at Byte, during the development of the coupon style that pops up in the Douyin video stream, a colleague suggested during the code review that I replace the PNG used for the dividing line with SVG.
Although I changed it at the time, my youthful arrogance made me think that the line on the coupon background, using PNG, was only a few KB. Why change it to a large SVG? It seemed unnecessary since even if all users saw it, it wouldn't consume much bandwidth. However, I later realized this is a mindset: seeing the small picture leads to understanding the big picture. If the size difference is significant, with the user base now at 800 million, the cost of bandwidth usage becomes astronomical. If it can be avoided, why not change it, haha?
Architecture Adjustments#
With gains, there are certainly costs, such as some pitfalls I encountered 👀.
Although the work done before the research was quite comprehensive, there were still some issues during long-term use, such as:
- The CD deployment process to Fly.io is too time-consuming.
- Many useful features have not yet been expanded.
- If there are too many resources, the access speed significantly decreases.
To address the above issues, I made some adjustments to the previous simple architecture, and I will discuss them one by one 👀.
The bottom line is: you still need to tinker, you still need to understand technology, you still need to debug, and you still need to maintain it🤣.
Deployment Logic Optimization#
The original deployment logic was Astro + Github CD + Fly.io.
The tech stack of the blog itself hasn't changed. Astro is updated and maintained frequently, and the community is very active. The only complaint is that Astro updates too quickly, and some simple, common component ecosystems are still quite lacking, such as image previews, automatic markdown menu generation, etc., which I still have to develop myself 👀.
The first problem I encountered was that the deployment time on Github was particularly long. Upon closer inspection, the issue was with Fly.io; the deployment process took too long.
Fly.io's remote runner has poor performance. When encountering Astro plugins that run image compression, it becomes very slow. Additionally, the entire folder needs to be packaged into a Docker image and sent to the remote server, which is unnecessarily complicated. I realized that this design was initially to utilize Fly.io's domestic access features, haha.
However, fortunately, I registered my domain recently, so I can use domestic OSS services. I suddenly discovered that I could just build it directly and throw it on OSS; there's no need to make it so complicated 🤣.
Now, after the overall optimization, a deployment only takes two minutes (running locally, reasons explained later 👀).
Useful Feature Expansion#
Although the blog prioritizes article quality over user experience, as evidenced by Hacker News, I do feel this relationship is indeed true.
However, this doesn't conflict with the fact that in situations where article quality cannot be improved in the short term, enhancing user experience is also a good choice, haha. A good user experience increases interaction rates, which boosts motivation to write, and can be considered a form of optimization, haha.
Traffic Volume#
For traffic volume statistics, I initially thought of using the free functions provided by MongoDB. It actually worked, but the problem was that this server is located abroad, and loading viewCount took about 10 seconds, which really affected user experience.
The current solution is to use N8N's workflow to provide a webhook. The page initializes by calling the webhook, executing logic to store the content in PostgreSQL. I will elaborate on the specific content in my next article, haha; there's a bit of a twist in it.
Support for Comments#
Here, I want to give a thumbs up to reorx. I saw his blog on Jike, and while reading, I found that he researched many technical implementation solutions, ultimately choosing remark42 as the solution. See the original article.
Adding comments to a blog is indeed a challenging problem. If you want user experience, you can't use domestic solutions; if you want domestic solutions, the user experience is poor. It's a typical dilemma.
Fortunately, the open-source commenting solution remark42 has solved this problem. Currently, I have deployed the comment server on my cloud server, and it has been quite stable for a while without any issues. Everyone is welcome to leave comments at the end of the article for testing, haha.
Slow Image Resource Loading Speed#
I first realized this problem after I published the final chapter album of Attack on Titan. When there are many images, the free bandwidth provided by Fly.io is definitely insufficient, and since I uploaded the original images, the loading speed is indeed slow, haha.
But coincidentally, the tools in the basket came into play. After moving the deployment to OSS, I added a layer of CDN on top, which solved the problem smoothly.
Here, I chose Qiniu's OSS + CDN service. One word to describe why: cheap. I registered with a school edu email, allowing me to use 40GB of OSS for free for a year, so I took advantage of that.
However, after using it, I found: the only downside of expensive services is that they are expensive, and the only advantage of cheap services is that they are cheap. Currently, uploading is quite cumbersome, and the caching strategy of qshell has issues, such as failed files not supporting retries, etc.
Moreover, running OSS uploads in Github actions is very slow because the runner is abroad... So the current logic is still to run the deployment locally, and after publishing, I have to handle it manually, which is a bit cumbersome. I will optimize this later.
Currently, the caching strategy is not to cache HTML, but the homepage is cached, not for performance reasons, but because it can't bypass 🤣.
As mentioned earlier, resources have been moved to domestic OSS, which relatively slows down access from abroad. Here, I directly opened a global CDN. Given the low traffic, the price is completely acceptable. If you're willing to tinker, you could consider DNS partitioning to Vercel, which should speed things up significantly. However, considering the lack of foreign traffic, I will leave it at that for now 👀.
Blog Summary#
Looking back at last year, I still wrote a few articles, although not many related to technology. Next time... definitely next time...
The Most Viewed Article#
This article I wrote last year has reached 1K views, mainly driven by traffic from Jike. It seems that in 2022, blogs are still a hot topic, haha.
In 2022, I Finally Wrote Another Blog Site
Conclusion#
When I first started writing this article, I just wanted to simply record how I upgraded the tech stack of my blog. Later, I thought, hey, this is just in time for the one-year anniversary of my blog's relaunch. Shouldn't I summarize it? Then I found myself writing more and more.
So many times, we have a strong output ability and desire, but we just need that one opportunity to think and organize our thoughts. Whether it's keeping a diary or writing a blog, it's a great form; the key is to write 👀.
Now that you've read this far, do you want to build a site? If you do, we can chat, haha. If you're interested, you can find me through Discord on the about page for a casual chat.
In the next update, inspired by Zeabur, I'll share some small projects I've been tinkering with 👀. Friends who are interested can subscribe via RSS 👀.