How to completely and absolutely disable internal ionic caching?


#1

I have been pulling my hairs because of internal ionic caching. You delete an element from the page html, but it still exists there. Old error messages suddenly start appearing even if the whole code has been replaced.
Do anyone of you face this issue ? Is there any solution for this.


Navigation & cache issue with tab & navpush
#2

Hi @VibeThemes,

There are many ways for such things like,

  • setting $ionicConfigProvider.views.maxCache(0);

  • In your template’s add this line :

  • You can also set the cache parameter in your routs like cache: false in .state(‘app.dash’)

  • Also you can load the new page like this: $state.go(‘app.dash’, {}, {reload : true});

Hope all of this helps you in getting your answer.


#3

Where to add this line : $ionicConfigProvider.views.maxCache(0); ?
inside the ionic project ?


#4

Hi @VibeThemes,

.

config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) {
    $ionicConfigProvider.views.maxCache(0); 
});

This is the place where you need to add this code.


#5

I am sorry, I am still unable to locate the file. I am using IONIC 2.


#6

I see that no one seems to have an answer for this. It is very difficult to build large scale projects when 1 day, 1 week old error messages suddenly start to appear even when the whole code has been changed and the line numbers simply do not exist. Ionic team should do something about this disease called “viewcaching”, it is literally killing us.


#7

Are you seeing issues in the browser? It may be your browser caching pages, which has resulted in me seeing issues as well.