diff options
Diffstat (limited to 'src/ng/http.js')
| -rw-r--r-- | src/ng/http.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ng/http.js b/src/ng/http.js index 99c1fff3..e4d695c4 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -306,6 +306,9 @@ 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 for 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`. + * * * # Response interceptors * @@ -733,8 +736,10 @@ function $HttpProvider() { promise.then(removePendingReq, removePendingReq); - if (config.cache && config.method == 'GET') { - cache = isObject(config.cache) ? config.cache : defaultCache; + if ((config.cache || defaults.cache) && config.cache !== false && config.method == 'GET') { + cache = isObject(config.cache) ? config.cache + : isObject(defaults.cache) ? defaults.cache + : defaultCache; } if (cache) { |
