خرید بک لینک

Vote count: 0

Im using angular-cache library to cache my rest query to browser in AngularJS,

angular.module('fbc')
  .service('OrganizationService', function (CacheFactory, $http) {
    // Service logic
    var settings,
    organizationCache, baseURL = "https://api.myapp.com/1";
    if (!CacheFactory.get('organizationCache')) {
      // or CacheFactory('bookCache', { ... });
      CacheFactory.createCache('organizationCache', {
        deleteOnExpire: 'aggressive',
        recycleFreq: 60000
      });
      console.log("No CacheFactory");
    }
    organizationCache = CacheFactory.get('organizationCache');

    settings = {
      cache: organizationCache
    };

    retu {
      getAllOrganization: function (promise) {
        retu $http.get(baseURL + '/Organization', settings)
          .then(promise);
      }
    };

  });

but every time I refresh the browser I can see No CacheFactory on my console it means it query every time and not using or their is no cache stored.

asked 55 secs ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 11 مرداد 1395 ساعت: 15:16

صفحه بندی