Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

handy_man's avatar

Slow loading with stripe?

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.

Hope that makes sense.

0 likes
9 replies
clin407's avatar

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.

jekinney's avatar

Are you using Cashier or stripes jQuery plugin? Also in test mode and local dev environment it could be a network issue.

handy_man's avatar

@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?

See this image of my network break down: http://i.imgur.com/FtC5L0y.png

@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).

jekinney's avatar

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.

handy_man's avatar

@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.

handy_man's avatar

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.

handy_man's avatar

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.

BKD's avatar

I experienced this last year and unfortunately it hasn't improved. Even dynamically loading invoices still leaves us with a poor experience.

BKD's avatar

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')

I hope someone finds this helpful.

Please or to participate in this conversation.