Merge "Force no caching for Angular $http requests"

This commit is contained in:
Jenkins 2015-10-15 09:54:51 +00:00 committed by Gerrit Code Review
commit 98a65a00ad

View File

@ -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
.module('refstackApp')
.run(setup);