Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clear cache in ionic application?

i have read so many blogs it says there is a bug in

$scope.logout = function() {

    $ionicHistory.clearCache();
    $ionicHistory.clearHistory();
    $state.go('home');

};

is there any solution for clearing cache using ionic code or using some angular code??

like image 521
Dixit Avatar asked Nov 04 '15 10:11

Dixit


People also ask

How do I clear cache on ionic app?

logout = function() { $ionicHistory. clearCache(); $ionicHistory. clearHistory(); $state.go('home'); };

How do I clear angular cache?

Angular cache There is no command to clear the cache, just run rm -rf .

What is the advantage of caching the views in ionic apps?

What is the advantage of caching the views in Ionic apps? Provide examples. Ionic by default caches up to ten views, which improves performance and also maintains different states in the views at the same time. For example, the cache can maintain scroll position in the views or active state of buttons.


1 Answers

using this plugin you can clear cache

Follow this steps

1) install this plugin https://www.npmjs.com/package/cordova-plugin-cache

2)write this line where you want to clear your cache

window.cache.clear()
like image 139
Dixit Avatar answered Oct 02 '22 20:10

Dixit