Strange duplicate post every time I edit the actual post, site pages or css

I’ll provide a few more details here for people who are curious how things work behind the scenes… If you don’t want the technical explanation, skip this.

  • When you post to Micro.blog, Micro.blog keeps the post in a database. When it’s time to publish, it writes the post to a Markdown file for processing by Hugo.
  • As an optimization, Micro.blog keeps most posts cached as Markdown files on each web app server. That way, it can quickly re-process everything. It clears this cache automatically when you choose the “Rebuild” button on the logs page, or after a few days.
  • When deleting a post, Micro.blog clears the post from the on-disk cache. Currently we have 3 app servers, so it needs to sync this deletion across every server. There must be a bug where this deletion sometimes fails, leaving around a stale cached Markdown file on 1 or more servers.
  • If a stale Markdown file is kept around, the “Rebuild” button will wipe it out but only from the specific app server that is currently being used to publish your blog. So it might pop back up again.

Of course, you shouldn’t have to know any of this. :slightly_smiling_face: When I fix this lingering bug, hopefully all of this will fade away to an implementation detail again.

2 Likes