Best practices for using Algolia as backend for JS frontend

Hi all,

We started using Algolia as a replacement for our internal API because we noticed it was much faster with its ~2ms response time. However as we start using it that way in more and more parts of our site we notice that response times are going up.

Here’s an example of how we use it: https://www.hackster.io/arduino You can see that the page is divided in multiple sections/rows, and each section is a request to Algolia. As you scroll down more sections load up. Tabs under https://www.hackster.io/arduino/projects and https://www.hackster.io/arduino/products also use Algolia for backend.

If you go to the main page and scroll down with the inspector open, you might notice that response times are far from the 2ms we got used to. Does anyone have tips and tricks and how to make it load really fast?

Cheers,
Ben

Hi @ben, can you provide us more numbers and where do you find those numbers or how do you compare them? Which tool do you use to measure this?

On your current website, I don’t see any issue, it’s very well done, very fast and when I scroll down results will show almost immediately.

For sure at a millisecond level, the more your go into your index, the more pages you traverse, the further you go the slower it will be.

Algolia was built preliminary for user interfaces with a searchbox input and being able to send relevant results on page 1 as the user types.

When it’s used in a “browse, scroll, infinite” ui then it’s still very fast, but the very nature of those UIs is to paginate through many many pages and so at some point yes it can slow down given how the index is built internally.

If this is a struggle, send us more insights and measurements you have done. If you are just curious, keep asking questions!

Hi Vincent,

I was mostly looking at it through the developer console, in the network tab. Some of the requests can take a while:
26 AM

57 AM
Does this have to do with my own connection/laptop?

Cheers,
Ben