I'm trying to achieve auto refresh for 2 community pages and was able to get the result. But if a user writing something in anyone of the page like he is filling a forum at the time of filling current data is getting lost when it's refreshed. What we are looking is the data should be there even after the refresh also.
Why not store data in local storage?
Whatever attribute you get, you serialize it and store it in the local storage, and when the component is initialized check local storage has value and populate it.
localStorage.setItem("lastname", "Smith");//set localStorage.getItem("lastname"); //retrieve
Another option would be to use Browser cookie: