-
Why is slow route transition which is waiting on the loader to resolve all data better than a SSG site? When I go from my
There's this slow/strange behavior in case there's a slow call to a 3rd party service inside of my loader. I tried to find resources that address this in remix but no luck. Isn't it better to have a SSG site in this situation? What am I missing? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Remix does not solve this by itself. In short, you will need to make your backend fast. That can entail any number of things. In your case, if a 3rd party service is consistently slow, you probably want to add some caching layer on your server for that service. If this is unfamiliar to you, a Google search for "Node.js Redis API Cache" should yield some good results. It might even be a good idea to add an appropriate example to this repo |
Beta Was this translation helpful? Give feedback.
-
@hollandThomas is right. Remix does only SSR on each request. This makes developing a remix app straightforward. For performance reasons, you would enable caching. There is a great video about http caching and different caching strategies here SSG is just caching at built-time. With remix, you would cache responses at runtime. Being able to serve cached content right from the CDN is as fast as it gets. When you want to serve fresh content fast, you need to make your data sources fast to reduce the time remix is waiting for the data before rendering the page. But as you have mentioned SSG, you would probably Cache on the CDN.
Only allowing one rendering strategy makes remix so simple and enjoyable. Caching, Edge-Computing, Fast Datasources will do the rest when it comes to performance. |
Beta Was this translation helpful? Give feedback.
@hollandThomas is right.
Remix does only SSR on each request. This makes developing a remix app straightforward. For performance reasons, you would enable caching. There is a great video about http caching and different caching strategies here
SSG is just caching at built-time. With remix, you would cache responses at runtime.
Being able to serve cached content right from the CDN is as fast as it gets. When you want to serve fresh content fast, you need to make your data sources fast to reduce the time remix is waiting for the data before rendering the page. But as you have mentioned SSG, you would probably Cache on the CDN.
Only allowing one rendering strategy makes …