Skip to content

Instantly share code, notes, and snippets.

@bulv1ne
Created October 4, 2014 18:41
Show Gist options
  • Save bulv1ne/d34a62f7dc471d41df56 to your computer and use it in GitHub Desktop.
Save bulv1ne/d34a62f7dc471d41df56 to your computer and use it in GitHub Desktop.
Angular simple http cache invalidate
angular.module('httpCache')
.factory('httpCache', function($http, $cacheFactory) {
var c = $cacheFactory.get('$http');
return function(url, cache) {
if (!cache) {
c.remove(url);
}
return $http({url:url, cache:true});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment