Guarding a stat-based file cache with ctime age and carrying it across EC2 stop/start with ext4 f_fsid Draft
I added a cache that skips opening about 8,000 JSON records at startup when their stat matches the previous run. A same-size rewrite within one timestamp tick produced an identical stat and returned stale bytes. Stopping and starting the EC2 host changed st_dev and turned every entry into a miss. The fix caches only files whose ctime is at least two seconds old, and on ext4 rebinds st_dev only when the UUID-derived f_fsid matches.