#SSR Performance Advice (Netlify)

4 messages · Page 1 of 1 (latest)

obsidian sundial
#

I've built a project heavily using SSR to allow for authenticated pages. It works really well locally (using dynamic data pulled from a live server via headless CMS), but once it's up on Netlify, page load times are horrible, frequently timing out and regularly taking 10+ seconds.

I was wondering if anyone had any good tutorials, videos, tip, or tricks in terms of either debugging or optimising page cacheing, Netlify function performance, or Astro SSR? Could this be some kind of cache issue, or malformed SSR code? Basically any intro or deep-dives would be appreciated!

(I believe the issue is predominantly in the build environment, not the APIs themselves, as they have been heavily optimised and, when queried directly, return values in ms counts; even if the Netlify and CMS servers are much further apart, it shouldn't be factors of 1000+ different)

celest jungle
#

If you have a repo to look through I can take a look if I have some time

SSR on netlify with Astro should be very performant still, I have a full SSR site pulling hundreds of dynamic DB items that still scores 98+ on mobile

My suspicion is that you have some kind of issue with the logic somewhere, as I've been through this EXACT scenario

For me it ended up being a loop within a loop that I had missed which was generating a very VERY large number of spans haha

That eroneous logic though was the cause of the performance issue and I suspect something similar may be happening here

obsidian sundial
# celest jungle If you have a repo to look through I can take a look if I have some time SSR on...

Yeah, I feel like this is almost certainly something I'm screwing up. The project itself is private (sensitive data, hence SSR), but I'm using the same patterns on the search for my personal site, and these are also pretty slow, so perhaps that might help.

Repo is here: https://github.com/theAdhocracy/theadhocracy-web-v4
Specific SSR'd search page: https://github.com/theAdhocracy/theadhocracy-web-v4/blob/trunk/src/pages/reviews/index.astro
Live page: https://theadhocracy.co.uk/reviews

Page load is about 5-6s for me. API response time (outside of Astro/Netlify) is around 120-200ms, and caches fairly aggressively for the content cards; the only one that is likely to be constant un-cached is the search endpoint, and even that will cache for short time.

GitHub

Contribute to theAdhocracy/theadhocracy-web-v4 development by creating an account on GitHub.

GitHub

Contribute to theAdhocracy/theadhocracy-web-v4 development by creating an account on GitHub.

celest jungle
#

Cool thanks, I can't make any promises as I'm pretty busy rn but if I can take a look I will