Catching an API, how?
Hi, got access to an api that will be updated like twice a day.
Im not sure how I should build this, I dont want to users spam the api when refreshing my page, and also, the backend should make the call otherwise the user would discover my api key right?
How I can make like a catching using next? Anyone knows any example? Thanks!
3 Replies
What the hell is a catching
Just invalidate the static page with nextjs invalidate thing on getStaticProps
i think you're looking for the word "caching"
😂 omg yes, thats why I wasnt able to get any result on google
So, in this case, getStaticProps, I thought I needed getServerSideProps
p.d. Yes, I think getServerSideProps is the thing I was searching for! 🙂 Since it allows me to do some caching and set a max-age