More plumbing/infrastructure work on the blog this evening. Post meta data is now written to a separate (JSON) file next to the entry. This makes it much easier to add stuff to meta (e.g., version number).
I've also swapped out IAsyncEnumerable
for Task<IEnumerable>
. I was having trouble working out when things (like reading the entry from disk) were actually happening, and worrying that they were happening more than needed.
Instead, BlogService.GetEntriesAsync
pulls all the meta files, and then individual entries pull (and cache) content.
Two thoughts from writing that last sentence: Is it worth running the load metas in parallel? And I should look at the proper in memory cache for entries (including content) and do things like invalidate the entry if/when edited.
I should benchmark the load stuff, and maybe set something going at process start time to pre-fill the cache.
(On the other hand, I actually want to get editing working and this is feeling like a distraction)