# How to force to delete cache via code?

**URL:** <https://forum.ionicframework.com/t/how-to-force-to-delete-cache-via-code/138624>\
**Category:** ionic-v3\
**Created:** [August 16, 2018, 11:55am UTC](https://forum.ionicframework.com/t/how-to-force-to-delete-cache-via-code/138624 "2018-08-16T11:55:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vicentllinares](https://avatars.discourse-cdn.com/v4/letter/v/ea666f/32.png) [@vicentllinares](https://forum.ionicframework.com/u/vicentllinares)\
**Post date:** [August 16, 2018, 11:55am UTC](https://forum.ionicframework.com/t/how-to-force-to-delete-cache-via-code/138624/1 "2018-08-16T11:55:15Z")

</div>

Hi all,

I’m having problems with cached data from server displayed on pages. When I change the data on server and I try to request it from the app, sometimes it fails because the app is still showing the old information (for example, images that has the same name then and now). If I go to android settings and clear the cache on the app my problem is solved.

Is there a way to clear that cached content via code? I can’t allow that problems of the devices of my users.

Regards and thanks!

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:23pm UTC](https://forum.ionicframework.com/t/how-to-force-to-delete-cache-via-code/138624/2 "2021-07-19T21:23:07Z")

</div>

Closed on July 19, 2021, 9:23pm UTC


