Weekly Indie Log #6

It’s Weekly Indie Log #6. I’ll be honest. Last week was meant to be marketing week but a pesky cache bug quickly torpedoed it into a coding week - an issue which threatened the value proposition of Stomod: unlimited posts and page views for your blog. Before we dive into the details, let’s first take a look at the MRR update. MRR Update This week we are at $239 MRR following a couple of new blogs created. The good thing with Stomod is that even if I do not get new subscribers, existing customers get charged per blog and each new blog created adds to the MRR. Marketing Week Killer Bug I started off last week with big plans for marketing week but I needed to investigate an issue reported by one of my customers about some 502 errors he was having on the blog. This made me very curious. You see, blogs hosted on Stomod are intelligently cached on our CDN so that they are generated once and served from the CDN for up to a month if nothing changes in the blog content - with the blog posts periodically revalidated every 5 seconds. The idea is that at any point in time, no matter the traffic your blog is getting, my origin server is only polled once every five seconds for a particular blog post. When I heard of 502 errors, I saw that it aligned with some of the maintenance downtime I had planned for the Stomod app at app.stomod.com. However, with my CDN setup, this should not affect blogs which should remain up. Investigation I started looking into the issue and quickly found out that for my customers using the /blog sub folder feature of hosting their blog under their main domain - for e.g. example.com/blog coupled with hosting on Vercel using the rewrites functionality in their vercel.json or next.config.json , Cloudflare (CF) cache status would always be MISS. This initially got me thinking that it might be a misconfiguration from my side which was not allowing reverse-proxied URLs to be cached properly on CF since other domain mapping types were working properly. After reviewing the configuration a thousand times and trying different configuration combinations, I couldn’t figure out what’s going on. I then started thinking that maybe Vercel’s rewrites that was sending headers to CF which busted cached. I did some further testing and while I could see Cache-Control: max-age=0 on my server logs, I could not have CF properly ignore this header. In retrospective, this led me down a rabbit hole where I got obsessed with this and how to resolve this when the issue was actually something else

Apr 10, 2025 - 08:23
 0
Weekly Indie Log #6

It’s Weekly Indie Log #6. I’ll be honest. Last week was meant to be marketing week but a pesky cache bug quickly torpedoed it into a coding week - an issue which threatened the value proposition of Stomod: unlimited posts and page views for your blog. Before we dive into the details, let’s first take a look at the MRR update.

MRR Update

This week we are at $239 MRR following a couple of new blogs created. The good thing with Stomod is that even if I do not get new subscribers, existing customers get charged per blog and each new blog created adds to the MRR.

Image

Marketing Week Killer Bug

I started off last week with big plans for marketing week but I needed to investigate an issue reported by one of my customers about some 502 errors he was having on the blog. This made me very curious.

You see, blogs hosted on Stomod are intelligently cached on our CDN so that they are generated once and served from the CDN for up to a month if nothing changes in the blog content - with the blog posts periodically revalidated every 5 seconds.

The idea is that at any point in time, no matter the traffic your blog is getting, my origin server is only polled once every five seconds for a particular blog post.

When I heard of 502 errors, I saw that it aligned with some of the maintenance downtime I had planned for the Stomod app at app.stomod.com.

However, with my CDN setup, this should not affect blogs which should remain up.

Investigation

I started looking into the issue and quickly found out that for my customers using the /blog sub folder feature of hosting their blog under their main domain - for e.g. example.com/blog coupled with hosting on Vercel using the rewrites functionality in their vercel.json or next.config.json , Cloudflare (CF) cache status would always be MISS.

This initially got me thinking that it might be a misconfiguration from my side which was not allowing reverse-proxied URLs to be cached properly on CF since other domain mapping types were working properly.

After reviewing the configuration a thousand times and trying different configuration combinations, I couldn’t figure out what’s going on.

I then started thinking that maybe Vercel’s rewrites that was sending headers to CF which busted cached. I did some further testing and while I could see Cache-Control: max-age=0 on my server logs, I could not have CF properly ignore this header.

In retrospective, this led me down a rabbit hole where I got obsessed with this and how to resolve this when the issue was actually something else