placeholder

My Blog is Hilariously Overengineered to the Point People Think it's a Static Site - Xe

My Blog is Hilariously Overengineered to the Point People Think it's a Static Site - Xe's Blog

Click to view the original at xeiaso.net

Hasnain says:

Great read, and it reminds me that I need to go and blog about my own blog setup at some point.

“Normally this would be terrifying, especially with the amount of traffic my blog gets (as represented by this handy graph here). You'd think that something that does a lookup on every post in the worst case for the most common thing on the biggest dataset would make performance terrifyingly slow You'd also think that with the amount of traffic I get that it'd be an active detriment.

However, this is when I play my trap card! When you look at the analytics you can see that the most frequently read article is the most recently posted one! This means that it's not actually a big O of n lookup most of the time. It's constant time complexity. In theory this design is the terrifying type of thing that you normally find out about after you accepted a job offer, but in practice it's fine. It is a bit weird though, and I may need to rethink this in the future, but this has scaled to almost 300 posts as-is so I think it's okay for now.”

Posted on 2022-09-13T04:45:49+0000