Display posts from another site using REST API in an asynchronous manner

Step 1: Learn how to use AJAX in WordPress Plugins/Themes. The trick is that your Javascript doesn’t get the Stuff from Beta Site, your Javascript calls a PHP-Function you coded that itself gets the Stuff.

Step 2: Keep using the Transients. Check within your Ajax Callback, if there is a transient. If there is, return it. If there isn’t, get the stuff from the Beta site with wp_remote_get, save it to the transient, then return it to your Ajax function.

Step 3: Put the Call to your AJAX-Function into the document.ready function.

Step 4: Profit 😉