Use getServerSideProps for a specific request once for multiple pages #11431
Unanswered
samschooler
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have two page that need to get store information from the api (I don't think I can use getStaticProps because I have hundreds of stores all on different domains all using the same page). I want the
/
and/cart
pages to both request the store info.Currently I have them both hitting an API endpoint in getServerSideProps, however even though its the exact same request, they both run it, and it delays render. Is it possible to only run one, and disable the call to the other if the client already has the data? Alternatively is there a way to do this efficiently without getServerSideProps or using getStaticProps with hundreds of stores using the same page?
Beta Was this translation helpful? Give feedback.
All reactions