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

high value for cacheFlushInterval causes caching to not work #126

Closed cgs closed 9 years ago

cgs commented 10 years ago

I'm writing a Phonegap app with data that changes pretty infrequently, so I figured I'd jack up maxAge and cacheFlushInterval. I'm not sure how high it needs to be to make caching just stop working, but a value of 2592000000 did it. If you set it to whatever is in the doc example, it will start working again.

.run(function ($http, DSCacheFactory) {
    DSCacheFactory('defaultCache', {
        cacheFlushInterval: 2592000000, // 30 days
        maxAge: 604800000, // 1 week
        deleteOnExpire: 'aggressive'
    });

    $http.defaults.cache = DSCacheFactory.get('defaultCache');
})
jmdobry commented 10 years ago

What do you mean exactly by "make caching just stop working"?

cgs commented 10 years ago

Sorry I wasn't clear there. Making multiple requests to the same url would result in a new request every time instead of for just the first request.

jmdobry commented 10 years ago

Okay, could you create a Plunkr or JSFiddle that demonstrates the issue? That would help a ton.

jmdobry commented 9 years ago

Closing because I’m not sure this is an issue, if you are convinced that this is really a bug, please feel free to re-open the issue and add more information:

Otherwise support is done via the mailing list.