Shopify - Why is initial aloglia page load so slow?

Hi,

When the aloglia shopify search page first loads it takes ~23 seconds to load the whole page. Watching network activity in chrome dev tools the document itself takes almost 16 seconds to load excluding images etc. at which point the page starts to show. Any ideas?

Cheers,
Rob

Hi @rbarron00,

I have a few questions for you :

  • Where are you located when loading this page?
  • What is your app ID?
  • Can you tell me exactly which file is super slow to load? (You can do it so through the network tab, but ping me if you have issues)

Depending on if it’s the minification of instant search (instant_search.js.min) or the query to Algolia API (https://{APP-ID}-dsn.algolia.net/1/indexes) or maybe others files, I will be able to dig more into your problem. :slight_smile:

One last thing, I am really sorry that you went into so much issues, but I really appreciate your feedback, it helps us building the perfect tool. :slight_smile:

Let me know if you have other questions!

Alex

Hi Alexandre,

To answer your questions:-

  • We are in Sydney, Australia and all our customers are in Sydney too.
  • App id is QLFO0TS0TC
  • “search?q=milk” is waiting for over 10 seconds ( have seen up to 16 seconds ) before a response comes back. I have included screenshot below.

Capture

Thanks,
Rob

Hi @rbarron00,

Thanks for sharing that information. :slight_smile: I think I understand your issue, looking at the content download I see that it took a few seconds from your connection to get the data, so my guess is this is coming from there.

The Javascript Algolia client has a retry strategy, with a bigger timeout every time you retry. If the result from the API is not coming under 200ms, then we retry this time with a bigger timeout.

Can you try to search on your website from another wifi spot?

Thanks,
Alex

Hi Alex,

Thanks for your response. Yes, it is a bit quicker on another network connection. The strange thing is normal collection pages are coming back in 6 seconds, but the algolia search takes 17 seconds on the same network connection? Which file is doing the retry?

Thanks,
Rob

Hi,

This might come from cache. Can you try to go on a specific collection pages in incognito mode ?
I believe the instant_search.min.js is the library where the retry feature is located.

Thanks,

Alex

Hi Alex,

I have done a test in incognito mode of load time as reported by chrome devtools :-

  • Algolia search page - 35 seconds - 12.6mb downloaded
  • Collection page - 8 seconds - 2.8mb downloaded

It appears to be the amount of data that algolia is downloading that is causing the slow load time?

Cheers,
Rob

Hello! :slight_smile:

12.6 / 35 = 0.36mb/s (this is the speed at which you downloaded, the result from Algolia’s API)
0,36 * 8 = 2.88mb

Both pages are downloaded at the same speed, so I believe you are right, this is the amount of data that is causing the issue. For which query do you have 12.6mb, this sounds like a lot. Milk ?!

Thanks,

Alex