Closed sriramjothimani closed 9 years ago
You can't set maxAge for individual items On Aug 19, 2015 8:40 AM, "sriramjothimani" notifications@github.com wrote:
Hi,
The maxAge property of individual item stored in a cache is not overriding the maxAge of the whole cache. Even though we set specific maxAge for the individual items it tends to set the maxAge of the cache.
Below is the service we have created.
appCache.service('appCacheSrc', function (CacheFactory) {
var frontendCache;
if(!CacheFactory.get('frontend')){ frontendCache = CacheFactory('frontend', { maxAge: 15 * 60 * 1000 ,cacheFlushInterval: 30 * 60 * 1000 ,deleteOnExpire: 'aggressive' ,storageMode: 'localStorage' });
frontendCache.put('/profiles/34', { name: 'John', skills: ['programming', 'piano'], },{maxAge: 60 * 1000});
} console.log(frontendCache.info('/profiles/34')); return frontendCache;
});
Please let me know if am doing something wrong.
Thanks, Sriram
— Reply to this email directly or view it on GitHub https://github.com/jmdobry/angular-cache/issues/194.
Ok so I have to create a separate cache if I need to have a different maxAge ?
Yes On Aug 19, 2015 8:53 AM, "sriramjothimani" notifications@github.com wrote:
Ok so I have to create a separate cache if I need to have a different maxAge ?
— Reply to this email directly or view it on GitHub https://github.com/jmdobry/angular-cache/issues/194#issuecomment-132626747 .
Hi,
The maxAge property of individual item stored in a cache is not overriding the maxAge of the whole cache. Even though we set specific maxAge for the individual items it tends to set the maxAge of the cache.
Below is the service we have created.
appCache.service('appCacheSrc', function (CacheFactory) {
});
Please let me know if am doing something wrong.
Thanks, Sriram