jmdobry / angular-cache

angular-cache is a very useful replacement for the Angular 1 $cacheFactory.
http://jmdobry.github.io/angular-cache
MIT License
1.39k stars 156 forks source link

Cache items dont expire in latest Chrome build #182

Closed chris-eaton closed 9 years ago

chris-eaton commented 9 years ago

Whilst using 4.2.0 and using the very latest stable Chrome build (given to all normal users) the cache never seems to expire. This functionality still works in FireFox.

var options = {
    maxAge: 10 * 1000, // Items expire after 10 seconds
    cacheFlushInterval: 10 * 1000, // This was never needed before, added now to test
    deleteOnExpire: 'aggressive',
    storageMode: 'localStorage'
};

var cache = CacheFactory('myCache' + currentUser.Id, options);

var data = cache.get(url);

if (data != null) {
      deferred.resolve(quicklinks);
      return deferred.promise;
}

"data" is never null / undefined even when it is expired. In FF and earlier builds of Chrome it would expire and return null when expired.

jmdobry commented 9 years ago

I just tested this in Chrome 43 stable and it works. Perhaps you can produce a plunker/jsfiddle/jsbin/codepen that demonstrates? And if 43 stable is out, who will be on 42? If you can produce a working demonstration, I'll take a look. Closing until then.