next.js: Initial page load too slow
There’s something quite inefficient going on e.g in the with-apollo example, the initial page load is way too slow:
PageSpeed Insights confirms (score of 75/100), sometimes saying the server responded in 2.5 seconds, sometimes in 1.1 seconds.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 15
- Comments: 44 (22 by maintainers)
Unbelievable. I have a simple project with 1 query deployed with next-apollo and WebPageTest is reporting 3.5s to first miningful paint. I will investigate and update this thread
Have you had any improvement on the matter? I’m having some harsh times with apollo and next.
We’re now tracking this on #now
Are you running in dev or production mode? In dev mode Next only compiles the page you are viewing so it will appear slower when navigating between routes. Production mode should be fine.
Also having issues. I think it has to do with how google measures speed or an incorrect timing event. I have a site where everything is cached (including html) and I consistently get the page load event under 500ms, after hydrate event fires at 1.2s (on pagespeed mobile) but my first content paint is 5s! I also use apollo but not sure how that could affect performance adversely (there are no requests made client side). Any leads on how to solve this would be appreciated.
have the same issue since all js need to be loaded react, Apollo client and redux before my first content full paint is calculated at + 3 seconds but my page loads < 1 seconds as far as I can tell. is there a way that my ssr render will count as my first contentful paint before they all load. individually the examples have a highscore in lighthouse but from what I can find with typescript, Apollo, React, and Redux they take greater than 3 seconds to fully load and reach fist contentful paint, Time to Interactive and Largest Contentful Paint. I thought SSR would fix all this. My first load JS is flagged as too large particularly my _app file but I don’t know how to reduce it as I still wish to use graphql and redux for my application. Next-auth also seem to reduce my score significantly
feels like next and by extension next-auth, react, redux and apollo cant compete with non spa pages or am I full messing everything up. let me know if sharing my repo would help.
@f2net did you have any improvement using next-apollo?
@cyprus-za did you manage to resolve this? I’m running in to a similar issue with performance with next and Apollo.
I’m having a similar issue where the container boot time is incredibly slow. After it’s booted, even a hard refresh takes 10x less time than previously. Does this have to do with which plan you’re on?
@alikhani There’s a single query in this example, so it doesn’t explain the current issue.