Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop the app to make ajax call for home page #3

Closed
elhampour opened this issue Apr 8, 2018 · 3 comments
Closed

Stop the app to make ajax call for home page #3

elhampour opened this issue Apr 8, 2018 · 3 comments

Comments

@elhampour
Copy link

when we make a get request to home page of the app, for example through the browser, the ajax call to get the list of all questions is redundant, because of server side rendering, we have populate the list of question from server,

so how can stop the app to make ajax request when the html is rendered from server ?

@danielstern
Copy link
Owner

This is a fair point, I'd be happy to look at a PR!

@elhampour
Copy link
Author

I found the solution . its because of the store.
we should send the store from server to client.
you can do it in a lot of ways. but i think the straight forward way to do it is to pass store through the html.

@GaddMaster
Copy link

GaddMaster commented Feb 16, 2020

This other project which has a different approach to server-side rendering does exactly this !!!!

https://github.com/StephenGrider/ReactSSRCasts

I'll be using this to get the state to client from server!

Which means we can check certain values fetched to avoid re fetching data we already have !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants