1 ### 2.x.x. ---> 3.x.x - xx April 2013
4 ### 1.x.x. ---> 2.0.0 - 30 October 2013
6 #### Breaking API changes
7 ##### Swapped `aggressiveDelete` option for `deleteOnExpire` option.
10 Aggressively delete expiring items.
12 $angularCacheFactory('myNewCache', {
13 maxAge: 90000, // Items added to this cache expire after 15 minutes
14 aggressiveDelete: true // Items will be actively deleted when they expire
18 Passively delete items when they are requested after they have expired.
20 $angularCacheFactory('myNewCache', {
21 maxAge: 90000, // Items added to this cache expire after 15 minutes
22 aggressiveDelete: false // Items will be actively deleted when they expire
27 Aggressively delete expiring items.
29 $angularCacheFactory('myNewCache', {
30 maxAge: 90000, // Items added to this cache expire after 15 minutes
31 deleteOnExpire: 'aggressive' // Items will be actively deleted when they expire
35 Passively delete items when they are requested after they have expired.
37 $angularCacheFactory('myNewCache', {
38 maxAge: 90000, // Items added to this cache expire after 15 minutes
39 deleteOnExpire: 'passive' // Items will be passively deleted when requested after expiration
43 Do nothing with expired items (not in 1.x.x).
45 $angularCacheFactory('myNewCache', {
46 maxAge: 90000, // Items added to this cache expire after 15 minutes
47 deleteOnExpire: 'none' // Items will expire but not be removed
51 ##### Substituted `localStorageImpl` and `sessionStorageImpl` options for just `storageImpl` option.
55 $angularCacheFactory('myNewCache', {
56 storageMode: 'localStorage',
57 localStorageImpl: myLocalStoragePolyfill // Use custom localStorage implementation
60 $angularCacheFactory('myNewCache2', {
61 storageMode: 'sessionStorage',
62 sessionStorageImpl: mySessionStoragePolyfill // Use custom sessionStorage implementation
68 $angularCacheFactory('myNewCache', {
69 storageMode: 'localStorage',
70 storageImpl: myLocalStoragePolyfill // Use custom localStorage implementation
73 $angularCacheFactory('myNewCache2', {
74 storageMode: 'sessionStorage',
75 storageImpl: mySessionStoragePolyfill // Use custom sessionStorage implementation
80 The Bower package now contains only `dist/angular-cache.js` and `dist/angular-cache.min.js`.
86 cache.get('someKey', function (key, value) {
87 // do something with expired item
93 cache.get('someKey', {
94 onExpire: function (key, value) {
95 // do something with expired item