Does invalidate(); perform an actual refetch?
I am half way into the course video and I see
void ctx.post.getAll.invalidate(); to show the new post we are making. Isn't this just refetching? Wouldn't it be better to have a local state/catch being updated when successful vs trying to refetch everything all over again? just seems very costly especially if an app grows. Please let me know if I am wrong in my thinking or how I should be thinking when we consider refetching data once successful. Thank youSolution
on personal projects where I know perfectly the architecture and every API call being made, I always update the cache, and set the stale duration to Infinity. On enterprise projects where 50 devs work on the same app, sometimes it's just a mess and you'd have to update 7 different cache entries and know exactly how the data is structured in each, so we tend to just invalidate
