I have successfully implemented HTML5 Push Notifications for my site, for news updates and user events. If an endpoint is no longer valid (for whatever reason, but generally because a user revoked permission in their browser) I get a 404 or 410 status from the push server when I try to send a notification. Then I remove that endpoint from my records.
But what I would like is to be a little more proactive and check if an endpoint is valid, so my stats of subscribed users are more realistic and are not updated only when a notification fails to send (which could take days or weeks).
I thought of sending an invalid push message (for example with the wrong VAPID keys) but I don't have the guarantee that a server would check the validity of the endpoint before the validity of the payload, so even if this worked it could break in any moment.
Is there any more elegant way that I could do this?