# Remove caching completely

**URL:** <https://forum.ionicframework.com/t/remove-caching-completely/30421>\
**Category:** ionic-v1\
**Created:** [August 13, 2015, 8:48am UTC](https://forum.ionicframework.com/t/remove-caching-completely/30421 "2015-08-13T08:48:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![akash21](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/akash21/32/90679_2.png) [@akash21](https://forum.ionicframework.com/u/akash21)\
**Post date:** [August 13, 2015, 8:48am UTC](https://forum.ionicframework.com/t/remove-caching-completely/30421/1 "2015-08-13T08:48:57Z")

</div>

Hi. 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 `$ionicConfigProvider.views.maxCache(0);`
- My template’s first line is this: `<ion-view class="home-view" cache-view="false">`
- Tried setting `cache: false` in `.state('app.home')`
- 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 `$route.reload` and `$window.location.reload` on resume but it’s not working.

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

Please help!

---

<div class="post-metadata">

**Author:** ![darshanp](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@darshanp](https://forum.ionicframework.com/u/darshanp)\
**Post date:** [August 13, 2015, 10:44am UTC](https://forum.ionicframework.com/t/remove-caching-completely/30421/2 "2015-08-13T10:44:36Z")

</div>

How are you getting your data from your Wordpress site? Is it (effectively) from a static URL? Are you seeing this on iOS or Android? We’ve had some caching issues on iOS where we’ve updating an image but it’s not taken affect on iOS when the app is re-opened, but does on Android.

---

<div class="post-metadata">

**Author:** ![akash21](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/akash21/32/90679_2.png) [@akash21](https://forum.ionicframework.com/u/akash21)\
**Post date:** [August 13, 2015, 1:03pm UTC](https://forum.ionicframework.com/t/remove-caching-completely/30421/3 "2015-08-13T13:03:30Z")

</div>

We’re using a JSON API plugin for Wordpress to retrieve the posts. And seeing this on Android. Building for Android only at the moment.

---

<div class="post-metadata">

**Author:** ![akash21](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/akash21/32/90679_2.png) [@akash21](https://forum.ionicframework.com/u/akash21)\
**Post date:** [August 13, 2015, 4:15pm UTC](https://forum.ionicframework.com/t/remove-caching-completely/30421/4 "2015-08-13T16:15:31Z")

</div>

So no one can help? ☹

---

<div class="post-metadata">

**Author:** ![akash21](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/akash21/32/90679_2.png) [@akash21](https://forum.ionicframework.com/u/akash21)\
**Post date:** [August 15, 2015, 6:46am UTC](https://forum.ionicframework.com/t/remove-caching-completely/30421/5 "2015-08-15T06:46:48Z")

</div>

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

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

```

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

---

<div class="post-metadata">

**Author:** ![gmarziou](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gmarziou/32/13327_2.png) [@gmarziou](https://forum.ionicframework.com/u/gmarziou)\
**Post date:** [August 15, 2015, 7:28am UTC](https://forum.ionicframework.com/t/remove-caching-completely/30421/6 "2015-08-15T07:28:00Z")

</div>

That’s how I do it also but to me it looks like Ionic’s view caching is half baked being too much intrusive.

---

<div class="post-metadata">

**Author:** ![akash21](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/akash21/32/90679_2.png) [@akash21](https://forum.ionicframework.com/u/akash21)\
**Post date:** [August 15, 2015, 8:16am UTC](https://forum.ionicframework.com/t/remove-caching-completely/30421/7 "2015-08-15T08:16:06Z")

</div>

Exactly. And I’m very much surprised there aren’t more posts than this on this topic.
