UNPKG

sheercms

Version:

Sheer Cliff CMS is a simple and powerful content management system (CMS) for Node JS.

34 lines (28 loc) 870 B
/* Angular Service: Cache */ app.service('CacheService', function($q, $http, DSCacheFactory) { var self = this; self.clearCache = function(key, type) { var d = $q.defer(); $http.post("/cms/cache/clear", { key: key, type: type }).success(function(data) { d.resolve(data); }).error(function(data, status) { d.reject(data); }); return d.promise; }; self.getStats = function(role) { var d = $q.defer(); $http({ url:"/cms/cache/stats", method: 'get', params: { }}).success(function(data) { d.resolve(data); }).error(function(data, status) { d.reject(data); }); return d.promise; }; self.clearClientCache = function() { DSCacheFactory.clearAll(); console.log('Client-side cache cleared.'); }; });