Merge "Force no caching for Angular $http requests"
This commit is contained in:
commit
98a65a00ad
@ -76,6 +76,24 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
angular
|
||||||
|
.module('refstackApp')
|
||||||
|
.config(disableHttpCache);
|
||||||
|
|
||||||
|
disableHttpCache.$inject = ['$httpProvider'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable caching in $http requests. This is primarily for IE, as it
|
||||||
|
* tends to cache Angular IE requests.
|
||||||
|
*/
|
||||||
|
function disableHttpCache($httpProvider) {
|
||||||
|
if (!$httpProvider.defaults.headers.get) {
|
||||||
|
$httpProvider.defaults.headers.get = {};
|
||||||
|
}
|
||||||
|
$httpProvider.defaults.headers.get['Cache-Control'] = 'no-cache';
|
||||||
|
$httpProvider.defaults.headers.get.Pragma = 'no-cache';
|
||||||
|
}
|
||||||
|
|
||||||
angular
|
angular
|
||||||
.module('refstackApp')
|
.module('refstackApp')
|
||||||
.run(setup);
|
.run(setup);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user