Handle-with-cache.c -
When you next write a cache in C, remember: every line of handle-with-cache.c is a compromise. Optimize for your workload, measure obsessively, and always — always — respect the underlying reality that caches are just optimistic lies we tell our hardware to make it faster.
pthread_rwlock_t cache_lock;
It forces developers to think about how to handle file updates. If index.html handle-with-cache.c