Hook
More breakout videos from this creator.
Dude, we have a huge problem. Users are complaining that even after they delete a post, other people are still seeing the post. That seems really bad. Did the post get deleted from our database? Yeah, it's completely gone from the database. Okay, well, could it be in a cache somewhere? Somebody makes a post, first it does go to our database, but then we also push it out to our CDN. We, we can't have every single request from users to look at posts hitting the database. You know how you can scroll infinitely down without ever having to wait for posts to load? That's because we preload them on people's devices. So this post could have been preloaded onto users' devices before it was deleted. Then when they scroll, they'll see it even though it's already gone. How do we fix this? I guess when someone deletes a post, we could remove it from the database and also force remove it from the CDN and also try to remove it from all the devices that have preloaded it. But that does seem pretty slow and expensive, not gonna lie. Is there anything else we could do? If you want a cheaper solution from us, instead of trying to force push it out of all the devices that have already preloaded it, we could just use something like set a five-minute TTL on the cache. This way, once it's deleted from the database, five minutes later, it'll be gone from the cache too. The only downside is people will be able to see it for those five minutes. So it's a little worse of a user experience.