Shots fired


Shots fired.

I've been a fan of Tanstack Query for years, but this post on caching by Convex has me thinking.

"Periodic invalidation and stale-while-revalidate are flawed strategies and are mostly broken by design. They can only reliably be used when applications have a very loose expectation of consistency and correctness."

I must admit that caching via stale-while-revalidate risks edge case bugs when related values invalidate at different intervals. Solvable, but an easy mistake to make.

Sync engines like @convex_dev, @zero__ms, and @ElectricSQL mitigate this issue by immediately notifying all clients when the DB changes, automatically.

Full post: https://stack.convex.dev/caching-in

View original on X