WordPress locations JSON oembed hyperlinks within the web page header, reminiscent of on this instance:
<head>
...
<hyperlink rel="https://api.w.org/" href="http://instance.com/wp-json/" />
<hyperlink rel="alternate" sort="software/json+oembed" href="http://instance.com/wp-json/oembed/1.0/embed?url=..." />
<hyperlink rel="alternate" sort="textual content/xml+oembed" href="http://instance.com/wp-json/oembed/1.0/embed?url=..." />
</head>
I by no means noticed a problem right here till just lately, after I started utilizing Mastodon as an extra social media outlet. Once I share my WP weblog posts on Mastodon, I seen my server will get hammered — floored — for about 4-5 minutes. I noticed load going over 100, with the same variety of httpd processes kicking off on my server, and searching on the logs I noticed that tons of of Mastodon situations (servers) have been concurrently hitting my weblog, GETing the URL offered within the above code. (Mastodon is a distributed community and, as such, it is not a grab-it-once affair — each server grabs it by itself.) This downside is just going to worsen as extra situations pop up.
I’m conscious that I can disable these hyperlinks within the header, however they supply details about that submit that I would really like the Masto situations to have. Is anybody conscious of a technique to cache these in order that each time a weblog hyperlink of mine is shared, my server is just not rendered incapacitated for a time frame?
I exploit W3 Supercache and am attempting the WP REST Cache plugin, however these will not be serving to. Within the case of the latter, it could be that (regardless of being an internet developer), I am lacking one thing so far as it with the ability to deal with this.
Certainly I am not the one individual to have felt this ache prior to now few months. Thanks.
bp