You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guide/angular-cache/http.doc
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -7,17 +7,17 @@
7
7
8
8
__Note__ The downside of letting $http handle caching for you is that it caches the responses (in string form) to your requests–not the JavaScript Object parsed from the response body. This means you can't interact with the data in the cache used by `$http`. See below for how to handle the caching yourself–giving you more control and the ability to interact with the cache (use it as a data store).
9
9
10
-
Configure `$http` to use a cache created by `$angularCacheFactory` by default:
10
+
Configure `$http` to use a cache created by `DSCacheFactory` by default:
11
11
```javascript
12
-
app.run(function ($http, $angularCacheFactory) {
12
+
app.run(function ($http, DSCacheFactory) {
13
13
14
-
$angularCacheFactory('defaultCache', {
14
+
DSCacheFactory('defaultCache', {
15
15
maxAge: 900000, // Items added to this cache expire after 15 minutes.
16
16
cacheFlushInterval: 6000000, // This cache will clear itself every hour.
17
17
deleteOnExpire: 'aggressive' // Items will be deleted from this cache right when they expire.
0 commit comments