navCtrl.push creates new instance of page


#1

I have a page in my app, where I read a lot of data on creation, and I did expect Ionic to reuse the page, when navigating to it later like this

this.navCtrl.push(AboutPage); 

but it looks like it creates a new instance each time, thus using memory, and using a lot of time to load the page.

I am using the tab starter template, and navigating between tabs is working as expected, but as soon as I open a new page, i can see that a new page is constructed, this executing both constructer and the ionView-events

My AboutPage, just for demo looks like this

  constructor(public navCtrl: NavController) {
    console.log("AboutPage Constructor called")
  }

  ionViewWillEnter() {
    console.log("AboutPage ionViewWillEnter called")
  }

  ionViewDidLoad() {
    console.log("AboutPage ionViewDidLoad called")
  }

And each time i click on the button to navigate to about page I get this in the console

AboutPage Constructor called
AboutPage ionViewDidLoad called
AboutPage ionViewWillEnter called

Will I have to create the page my self, and then try to reuse that each time I want to open that page ?

I am on latest version of Ionic


#2

Ok, this seems to be the intended way it should work according to

So does anyone have an idea of how to set

ionicConfigProvider.views.forwardCache(true)

in an Ionic3 app (with lazy loading)?