This is not hard.
This is not hard.
Just send a new message, exactly as you would post an original item/comment/etc, but have some special text/field in there that says "please ignore the previous message". The UI would then hide the previous message.
eg
COMMENT: {id:9374758, from:"mibbitier", data:"I hate you all!"}
COMMENT: {id:9374759, from:"mibbitier", data:"*IGNORE_MESSAGE_IN_UI* 9374758"}
Nothing whatsoever to do with infrastructure. Nothing to do with caches. Purely to do with the UI. Not rocket science.Granted, it's a poor way to do it, but it's better than nothing, and easier than trying to invalidate caches etc
It's also still visible if someone is using noscript (actually, I have no idea if Facebook works with noscript, probably not).
The solution you are suggestion doesn't solve the problem and injects more corner cases.
That's why you hire more experienced developers: they're more experienced, not at things like cache invalidation (sure, just nuke your entire cache anytime anything changes! easy!), but at managing complexity.
Which is difficult.
That's why I try to keep my mouth shut about how somebody should "just do this, it'd be so easy, why are they dumb?"