As I am using next-i18next, I figured that I am calling language API (json format) when I build the next.js project by using i18next-http-backend
in next-i18next.config.js
Downside of it, is that I need to REBUILD the project when language data is changed ...
So, I found this function called i18n.reloadResources()
which works perfectly inside getServerSideProps()
. (The reason why I want to avoid server-side rendering is that the language data is way too big. more than 800kb, for one language and I have 15 language translations. Every pages with 800kb API call is miserable ... I think)
However, I do not want to call API every time I re-render the page, and I found out about Incremental Static Regeneration (ISR, on-demand), but seems like it does not work the same way. In other words, it is not working.
Any suggestions for this type of situation?