We are building a proxied app for a client that has a custom shopping guide component (http://pocparties.com/apps/drupal-product-builder/baby-shower for example).
As you can see, the application is large (several megabytes). So it is a large page. My question is why, when we load it on our own server (not through the proxy), is the request instantaneous (just a couple of seconds). When we load it through the proxy, Shopify takes upwards of 15 seconds to process the request. I do realize the page is large so the load time on the front-end will be a bit longer (hence the loader bar). But why is the request taking so long?
Just wondering if anyone else has encountered this issue or if there are any possible workarounds? We do plan on (eventually) splitting the builder into ajax steps but in the short term we have a very slow loading page.
Any insight would be amazing. Thanks so much guys!
Proxy results you provide are a string. So when a request hits your server from the proxy, that takes time. Some servers are idle and only spin up to process a request when hit with one. That can be 6 seconds... not saying yours idles but hey...
Now you respond. You decide to build some massive megabytes string. You return that string out the door as the response. One stinking huge asset. A massive string.
Now Shopify gets that string and parses it for Liquid. LadeeDa... that takes time. You think a computer can parse a few megs of Liquid quick.. but hey...
Now once Shopify chews through your string, it combines your string with the shop's chrome... and you're rendered.
My guess is the system is only messed up if you send a simple string with a teeny bit of Liquid and that still takes 15 seconds. That indicates either your server is not networking right, or Shopify Proxy services are truly slow.
Did you test that?
Did you try a simpler approach like embedding your mega App inside an <iframe>?
Can't see the app through the link you posted above.
I don't have experience using app proxies, but could it be that you're seeing such delays because the app proxy is effectively not caching your target while the browser is. I'd bet that if you turned of the browser cache and loaded your app as is, it would also take MUCH longer to load considering it's a few MBs.
Just a thought.
The App Proxy is not the problem. After all, it is nothing more than a GET or POST you make to your server. If your server is failing to respond in 15 seconds with a payload, that is on you to figure out. Shopify plays little role in this short of the security aspect ensuring the Proxy calls are authentic.
@Karl might be on to something there about cache. You might also consider that sending MB of data is awkward? Are you sure that is a good architecture? The two things App Proxy are used for 99.0% of the time are:
Thank you for these thoughtful responses! I got locked out of my forums account for a while (continually contacted Shopify to try to get access, to no avail). Finally I got access so I just got these replies.
Not sure if I can formally do this but we can consider this topic "closed". I am no longer working on this project actively, and we haven't really approached a project in a similar way since.
Your feedback will be super helpful if I need to refer back to here in the future.
Thanks again, everyone!
|2 hours ago|