angular-cache v4.6.0 is an advanced replacement for Angular's $cacheFactory, designed for Angular 1.x applications. It supports time-based expiration, localStorage/sessionStorage backends, LRU eviction, and custom storage adapters. Unlike $cacheFactory, it offers features like item 'touch', expiry callbacks, cache disable/enable, and bulk operations across caches. It is distributed via npm and Bower. Maintenance mode as AngularJS itself is in LTS; last release was 2017.
npm install angular-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic setup, default configuration via CacheFactoryProvider, creating a cache with localStorage, and using it with $http.
Update to 4.6.0 (latest). Review the CHANGELOG for migration details.
Consider migrating to Angular (2+) with a modern caching library like ngx-cache or localForage.
Always check existence before use: if (!CacheFactory.get('myCache')) { CacheFactory.createCache('myCache', ...); } var cache = CacheFactory.get('myCache');Replace CacheFactory('myCache', {...}) with CacheFactory.createCache('myCache', {...}).Use a different caching library for Angular 2+ applications.
Add 'angular-cache' as a dependency: angular.module('myApp', ['angular-cache']).Call CacheFactory.createCache('myCache', options) instead.Ensure the cache exists before using it. Create it first: if (!CacheFactory.get('myCache')) { CacheFactory.createCache('myCache', ...); } then get it.