keepAlive on homepage

I have a question to which I have been unable to find a proper answer. Perhaps I am even using the wrong method to achieve this.

I have two pages, one is the home page. I go to the second page through a link <a href="/page2/>.

There, there’s some JS that adds content to the page before. I expected the KeepAlive (in the routes.js file) to make it so that when I go back to the homepage, my new added content is there. But it isn’t. If I repeat the procedure again, it works. It’s like I would need to specify KeepAlive on the homepage as soon as the app is opened the first time, while right now it only gets applied the first time I navigate to it through menu link. Any way around this?

Is the initial page loaded from component or template or URL? If it just in main index.html it won’t work

I believe it is. Any proper way to change this?
immagine

I’ve configured nothing else at the moment.