I just had a moment of realization, and took less than an hour to implement a fix for this website that has been bugging me for at least a year.
I now cache a hash of the file contents in the database, and when viewing a post, if the hash has changed, I rebuild the DB index. This saves me the step of going in and running the "rebuild index" command when I hand-edit files.
WeChat ID
aaronpk_tv