Skip to content

Instantly share code, notes, and snippets.

@savitskiyan
Last active December 7, 2015 11:14
Show Gist options
  • Save savitskiyan/b9a688a4b9d426bc1dc8 to your computer and use it in GitHub Desktop.
Save savitskiyan/b9a688a4b9d426bc1dc8 to your computer and use it in GitHub Desktop.
Disable IE caching in angularjs application
angular.module(ApplicationConfiguration.applicationModuleName)
.config(['$httpProvider', function($httpProvider) {
//initialize get if not there
if (!$httpProvider.defaults.headers.get) {
$httpProvider.defaults.headers.get = {};
}
//disable IE ajax request caching
$httpProvider.defaults.headers.get['If-Modified-Since'] = 'Mon, 26 Jul 1997 05:00:00 GMT';
$httpProvider.defaults.headers.get['Cache-Control'] = 'no-cache';
$httpProvider.defaults.headers.get['Pragma'] = 'no-cache';
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment