Foxy Forum Status

We're no longer responding to questions via our forum, but we will keep it up for historical reasons. If you can't find the answer you're looking for, please visit our knowledge base or contact us. If there's enough interest in the future, we may bring the forum back.

Slow cart load & reliance on readyState "complete"

Is there any reason your scripts are relying on document.readyState "complete" everywhere instead of "interactive"?

It makes the cart load after all subresources, including all images.
This makes for a very slow cart load, especially for those on mobile.

Why isn't a readyState of "interactive" or the usual jquery-style onReady (DomContentLoaded) event good enough?

I run a store page that is very simple, but does have a good many thumbnails.
Our customer base is 80% mobile tablet users on a mobile network.

If the customer knows what they want, before absolutely every single images loads on the page...
I'd rather they see the side-cart view than the full page cart, which is what happens when the side-cart doesn't load til the very very end.
  • lukeluke FoxyCart Team
    Hello @csmerritt. Thanks for posting.

    Unfortunately @brett is out today and he's the most familiar with the foxycart script loader. We'll have to get back to you next week with more details and what work-around options you have.
  • brettbrett FoxyCart Team
    Hi @csmerritt.
    Great question. Truth be told, we spent a LOT of time on our current approach, but if there's an improvement we could make, we'll definitely look into it.

    Could you whisper me the page you're testing on? I'd like to see if we can make some improvements. (If you happen to have already done some testing on this, I'd be interested to know if you think the issue is in the loader.js code or in the foxycart.js that the loader uses. And if you've tried removing the async and defer attributes from the loader.js script tag.) There are a few different pieces here, and I want to make sure we're looking at the right one.
  • brettbrett FoxyCart Team
    Hi again, @csmerritt.
    Researching this issue has taken us pretty deep down the rabbit hole. The addition of the readyState complete check was added in order to allow things like Require.js to work, but in revisiting how loader.js is working, I think there's room for improvement.

    I'd still love to see the page you're testing on, as it'd be helpful for us to test against. (We'd make a local copy and remove any analytics scripts you have, fwiw.)

    We'll keep you posted. Thanks for bringing this to our attention.
  • I'd like to reiterate this issue. Normally when you click on a link in a web browser, nothing happens for a second, and then you see the web page that you clicked on start to load. However, when I click any of the Foxycart "Add to Cart" button, I see a completely white webpage for 3-5 seconds and nothing in the cart appears until apparently all the resources of the page are loaded. Is there a way to speed up the loading time and/or make it so that users don't see this intermediary white page? This issue seems to be most pronounced in Firefox.
  • fc_adamfc_adam FoxyCart Team

    Could you whisper us the page you're working with so we can replicate what you're seeing? That doesn't sound like an expected behaviour so we'd love to see it in action.
Sign In or Register to comment.