1.

What is the benefit of caching views in Ionic applications?

Answer»
  • Views are cached by DEFAULT to increase efficiency. The element of a view is left in the DOM when it is navigated away from it, and its scope is separated from the $watch cycle. When you navigate to a previously cached view, its scope is reconnected, and the existing element in the DOM becomes the current view. This also allows prior views' scroll positions to be preserved.
  • CACHING can be TURNED on and off in a variety of ways. IONIC caches a maximum of 10 views by default, and not only can this be changed, but APPLICATIONS can also specify which views should and should not be cached explicitly. Caching can be turned off per view by setting cache: false in the state settings of the UI router. The$ionicConfigProvider may be used to specify the maximum number of cached views, but it can also be used to turn off all caching by setting it to 0.


Discussion

No Comment Found