Sending Webmentions More Intelligently
In Reader Mail: Webmention Spam I mentioned that since I started to send Webmentions post-deployment of this site I happened to be spamming everyone multiple times a day with my Webmentions.
I received a few comments from folks about reducing this (or completely stopping it) because some Webmention servers don't de-duplicate sent Webmentions, so a server could see each new Webmention as a new one, and could i.e. send a push notification to the user. Not ideal!
Because my site may update multiple times a day (i.e when I'm pushing new content to it) it means those duplicate Webmentions would be happening many times a day.
It's been less of a priority for me personally because it doesn't impact me much - which is a bad way to look at it, and really isn't fair on others, so for that I apologise.
After a couple of weeks of on-and-off work on it, I've managed to get it working yesterday, but today it's now production-ready.
It now will attempt to send a Webmention, and as soon as that Webmention has been successful, it will make a note of it. On the next time it looks to send Webmentions, it will not re-send the Webmention if it's already been sent. I'll be updating it in the future to resend only if I've changed the Microformats2 markup (via Marty McGuire).
A point of note is that it will not retry if the Webmention is rejected, either, because it's likely the remote server not wanting to accept the request.
This article being pushed live should be the last time you get inundated by Webmention spam from me!