diff options
| author | Julien Sanchez | 2013-11-06 11:32:39 +0100 |
|---|---|---|
| committer | Pete Bacon Darwin | 2013-11-13 20:20:59 +0000 |
| commit | 717a6705e2f308befd4948ae2815c85dd10791c7 (patch) | |
| tree | f556208f2512965e6ea82b5768d9907f19af379a /src/ng/http.js | |
| parent | 37ac4724ba50ddbf2cd7da377579dad9bb07969b (diff) | |
| download | angular.js-717a6705e2f308befd4948ae2815c85dd10791c7.tar.bz2 | |
docs($http): improve $http's caching documentation
Make the possibility to pass a custom cache instance to $http more obvious.
Closes #4803
Diffstat (limited to 'src/ng/http.js')
| -rw-r--r-- | src/ng/http.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/ng/http.js b/src/ng/http.js index 780f5561..e7bbb8bc 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -324,9 +324,11 @@ function $HttpProvider() { * * # Caching * - * To enable caching, set the configuration property `cache` to `true`. When the cache is - * enabled, `$http` stores the response from the server in local cache. Next time the - * response is served from the cache without sending a request to the server. + * To enable caching, set the request configuration `cache` property to `true` (to use default + * cache) or to a custom cache object (built with {@link ng.$cacheFactory `$cacheFactory`}). + * When the cache is enabled, `$http` stores the response from the server in the specified + * cache. The next time the same request is made, the response is served from the cache without + * sending a request to the server. * * Note that even if the response is served from cache, delivery of the data is asynchronous in * the same way that real requests are. @@ -335,9 +337,13 @@ function $HttpProvider() { * cache, but the cache is not populated yet, only one request to the server will be made and * the remaining requests will be fulfilled using the response from the first request. * - * A custom default cache built with $cacheFactory can be provided in $http.defaults.cache. - * To skip it, set configuration property `cache` to `false`. + * You can change the default cache to a new object (built with + * {@link ng.$cacheFactory `$cacheFactory`}) by updating the + * {@link ng.$http#properties_defaults `$http.defaults.cache`} property. All requests who set + * their `cache` property to `true` will now use this cache object. * + * If you set the default cache to `false` then only requests that specify their own custom + * cache object will be cached. * * # Interceptors * |
