Completely remove caching in Ionic

I have an application that reads the latest posts from my Wordpress site and displays it in a list. The problem is that every time the user opens the application again, he downloads the old (cached) list of articles, even if there are new posts on my site.

I went through all this in terms of disabling caching in ion mode:

I installed $ionicConfigProvider.views.maxCache(0);

The first line of my template is: <ion-view class="home-view" cache-view="false">

Tried setting cache: false in .state('app.home')

I tried to load the state as follows: $state.go('app.home', {}, {reload : true}); Doesn't work as expected.

I tried to clear the cache as follows: $ionicHistory.clearHistory(); $ionicHistory.clearCache(); $ionicHistory.clearHistory(); $ionicHistory.clearCache();

I even tried things like $route.reload and $window.location.reload , but it doesn't work.

None of them work. I am at the end of my rope here!

Please, help!

+7
angularjs caching cordova ionic-framework ionic
source share
1 answer

What I finally did was load the pull function to update before BeforeEnter as follows:

 $scope.$on('$ionicView.beforeEnter', function () { $scope.doRefresh(); }); 

You never know, this can help someone else who is in the same situation as me :)

+5
source share

All Articles