I've been working on a project with stripe, it's not finished yet so stripe is set to test mode, the page in question where I am seeing massive slowdowns has stripe data in it such as when their next bill will occur, their invoices etc.
The page is taking me a good 10+ seconds to load, this is a massive loading issue and my only thought is that it's stripe.
My conclusion for this comes from the fact that I have taken the grab for invoices and placed this into an AJAX request that starts loading after the rest of the DOM and that takes a good 5 seconds on its own.
Does anyone else have issues with Stripe in test mode? I would just prefer to know I'm not alone on this and that Stripe understandably don't give the best speeds for their API requests when a user is in test mode.
If you use a modern browser, most of them have developer tools with waterfalls as one of the tabs. In chrome, if you open their developer tools, select the network tab, you can see which resource is taking up most of the time. For example, here's how this page loads for me: http://chrisl.in/s/5dce49.png.
Can you confirm that it's Stripe first then it'll be easier to track down the actual issue.
@clin407 All of the loading times is coming from the dashboard page and the "Waiting (TTFB)" meaning the time to first byte, so therefore there's some processing going on in the background that I can't see taking up all of this time?
@jekinney I'm using Cashier and have also used JQuery's checkout plugin but for the most part I'm moving away from that in favor of my own custom forms. The loading in question isn't about processing a payment however (though this does also take some time, but I can account for that by loading animations).
Ouch, that get invoices is atrocious. Is that something that can be sent to the background? Of the top of my head, that is the method that takes the transaction data and generates a PDF? If so, that is a slow process.
@jekinney That get invoices is already loaded via AJAX (essentially when the user loads the dashboard they'll see a spinning loading icon where their invoices should be which will be populated as soon as it's generated.
It all in all rather slow but surely it can't be this slow in production? Might just have to deploy a server and try it out on there.
Loaded up a test server in what would be considered the final environment, my loading speeds are about 1/2 of what they used to be but 5 seconds is still pretty awful.
Just in case anyone else finds this because they are having similar issues, this is definitely stripe and this was fixed by loading the stripe information after the initial page has loaded using AJAX.
In case anyone is still looking for ways to increase performance, I stopped leveraging cachier's onPlan() method and I'm explicitly calling stripe_plan and other fields directly from the User (or Sentinel) model and the page loads almost instantaneously.
Additionally, I've separated invoices into its own dedicated page since calling invoices() still takes 5-7 seconds to return.
Sentinel::getUser()->stripe_plan vs Sentinel::getUser()->onPlan('starter')