userimage

How do I cachebust and how to use in $http and html partials?

How do I cachebust/cache-buster and how to use in $http and html partials?

userimage

Basically cachebuster is a unique piece of code that prevents a browser from reusing and things that has been already seen and cached, or saved, to a temporary memory file by the browser.

To use cachebuster try below code:


myAppModule.config(function($routeProvider, $provide) {
  $provide.decorator('$http', function($delegate){
    var get = $delegate.get;
    $delegate.get = function(url, config){
      url += (url.indexOf('?') !== -1) ? '?' : '&';
      url += 'v=' + cacheBustVersion;
      return get(url, config);
    };
    return $delegate;
  });
});
Answer is