I have an Azure WebApp hosting a MVC WebApp serving as a cloud service and a HTML/PHP page accessing data via the Cloud. Also in the Cloud, I have a multirequest function that reroutes URL requests internally - ie you post a request to http://MySite/reroute with two internal addresses, http://MySite/a and http://MySite/b. The function than calls HttpClient to execute both and returns the results. This was made to reduce latency when multiple calls are made in succession.
The problem I'm facing is the internal connection. I want a fast local connection, but it appears that all the calls to http://MySite/a take just as long from the Azure server than from my local pc. As for the PHP, I cannot access the WebApp internally as I can't get a local address.
Does anyone have an idea how to connect the WebApp to itself or how to connect the PHP site to the WebApp locally?
EDIT: I realized after a comment that this does indeed make no sense. So, I'm going to ask another way.
I have one WebApp. Inside are a WebApi using .net app (cloud) and a PHP/HTML frontend. There are two questions here, with a similar convergence point: How to connect to the cloud either from within the cloud or from a php script so that it does not make the round trip to the DNS servers and back (as you would on localhost on your own server)?
The reason for this is the execution time of a function is about 30ms. Because of latency, the round trip to the cloud and back (via postman, from my PC) takes anywhere from 150ms to 300ms. So, four requests, four round trips adds up to way more time than four packaged requests+overhead and one round trip.
The above is true if the frontend is hosted on a local server, and the cloud on Azure. If the frontend is hosted in another WebApp on the same plan, the latency is about 60ms for a round trip, but if it's on the same WebApp, it's about 15ms (using external URL). I'd like to further reduce this by connecting internally. Turns out, a call from cloud to cloud using the external URL takes about 400ms, suddenly making the packaging method obsolete. No idea why.
EDIT 2: As of today, I've switched from my own process to the .net batch request handler, which appears to be working great. Now I just need an internal address to connect the PHP frontend and cloud locally. Any idea where I could find one?