Slow initial load times with Next.js SSR #5361
Unanswered
andrew-braun
asked this question in
Q&A
Replies: 0 comments 9 replies
-
Where is your Algolia server vs the server that's hosting the search? Could it be that they're physically far apart? |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've got a Next.js app hosted on Vercel, mostly using static site generation (SSG), but we went with SSR for the one page that's currently using Algolia to display an initial product list and search the list. We'd initially been using CSR, but speed tests were coming upt pretty abysmal and CSR isn't the most SEO-friendly. Switching to SSR (using react-instantsearch-hooks) bumped up the speed quite a bit, but we're still seeing 5+ second initial load times, which obviously isn't ideal.
The implementation is pretty much in line with the Next.js section of the Algolia SSR docs.
The site is preconnecting, I've pared down the Algolia response to only the properties we're using on the frontend, components are being imported dynamically, the cache control headers are set up--and we're still getting long load times. Is there something obvious I'm missing? I'm fairly new to Algolia, so very possible there's a trick I'm not savvy to.
I'm thinking of trying SWR or getting creative, like using ISR to regularly update a static non-Algolia page of data and then replacing it with the Algolia components when they're ready, but obviously would prefer to stick with the SSR solution Algolia provides out of the box.
Beta Was this translation helpful? Give feedback.
All reactions