Tuesday, 28 July 2015

How to clear cache in angularjs




for angular
var myApp = angular.module('myApp', ['ngRoute']);
 
myApp.config(['$routeProvider', '$httpProvider', function($routeProvider, $httpProvider) {
    $httpProvider.defaults.cache = false;
    if (!$httpProvider.defaults.headers.get) {
      $httpProvider.defaults.headers.get = {};
    }
    // disable IE ajax request caching
    $httpProvider.defaults.headers.get['If-Modified-Since'] = '0';
    //.....here proceed with your routes
}]);



for jquery


<script type="text/javascript">


$(function () {






$.ajaxSetup({
cache: false





})


});
</script>





2 comments:

  1. very informative & different one....
    I would like to share the information to get jobs easily
    Angularjs Training In Hyderabad

    ReplyDelete


  2. Thanks for the great article this is very useful info thanks for the wonderful post.

    Best Devops Training Institute

    ReplyDelete