For my site, a user needs to authenticate with a 3rd-party service. I collect credentials using a lightbox, then pass the details to a jsw function which uses fetch() to the call the 3rd party service. The 3rd party API call usually takes about 1 second to complete. But it’s taking about 8 seconds in production! I’ve profiled the process and most of that time is just waiting for the jsw function to launch. Once it finally does execute, it only takes a few seconds to complete.
As an experiment, I took the original, slow loading, jsw function and put it into the http-functions file. Calling the function from there takes only 4 seconds in production… 1/2 the time!
Am I doing something wrong? Is it normal for jsw functions to take so long to execute?