From a39a1561c64275cc7d5f64d4081956ace8fcbe5e Mon Sep 17 00:00:00 2001 From: Julien Sanchez Date: Wed, 6 Nov 2013 11:32:39 +0100 Subject: [PATCH] Improve $http's caching documentation Make possibility to pass custom cache instance to $http more obvious. --- src/ng/http.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ng/http.js b/src/ng/http.js index 780f5561b813..2bb30a709e16 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -324,9 +324,10 @@ 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 configuration property `cache` to `true` (local cache) or to a + * cache instance built with $cacheFactory. When the cache is enabled, `$http` stores the + * response from the server in the cache. Next time 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,8 +336,8 @@ 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`. + * A custom default cache built with $cacheFactory can also be provided in $http.defaults.cache. + * To use it, `cache` configuration property should be set to `true`. * * * # Interceptors