Inconsistent Response Timings w/ WebServer on Photon

Hi, I am using the WebServer library to handle incoming JSONP requests on my Photon, they occasionally come in fairly rapid succession (~3Hz) and sometimes many minutes in between. For the most part it works well with quick response time, I’ll have network timings for my JSONP command that look like:

But, approximately every 10 commands or so I will randomly have a command that takes much longer to process/complete:

I am in SEMI_AUTOMATIC mode (connected to Wi-Fi but not Cloud) and in the setup() section of my firmware I have:

WiFi.connect();
WiFi.ready();
webserver.addCommand(“myCommand”, &myCommand);
webserver.begin();

And the myCommand function looks like:

void myCommand(WebServer &server, WebServer::ConnectionType type, char url_tail, bool tail_complete)
{
server.httpSuccess(“application/javascript; charset=utf-8”);
server.write((uint8_t
)myResponse,strlen(myResponse));

// do stuff…
}

And myResponse looks like:

const char myResponse = “jsonpCallback({“result”: “success”});”;

One piece of anecdotal evidence that may just be coincidence, the issue seems to occur less often late at night (perhaps when there’s less other Wi-Fi traffic in the area?). But it’s connected to just my home network which has nothing else connected to it except my laptop.

I have also noticed that sometimes the very first JSONP command sent to the Photon returns the success headers, but a blank body. Then every command after that returns the response body as well like it should…?

Any suggestions as to what might be causing this inconsistent behavior and occasional commands taking so much longer to process?

Thanks!