Ako Ako - 6 months ago 56
AngularJS Question

Remove caching completely in Ionic

I have an app that reads the latest posts from my Wordpress website and displays it in a list. The problem is every time the user reopens the app it loads an old (cached) list of articles even though there are new posts on my website.

I've been through it all in terms of disabling caching in ionic:

I've set


My template's first line is this:
<ion-view class="home-view" cache-view="false">

Tried setting
cache: false

Tried loading a state like this:
$state.go('app.home', {}, {reload : true});
Did not work as expected.

Tried clearing the cache like this on resume:
$ionicHistory.clearHistory(); $ionicHistory.clearCache();

Even tried stuff like
on resume but it's not working.

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

Please help!

Ako Ako

What I finally ended up doing was to load the pull to refresh's function on beforeEnter like this:

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

You never know, it might help someone else who finds themselves in the same situation as me :)