angular-loading-bar icon indicating copy to clipboard operation
angular-loading-bar copied to clipboard

Add option to disable cache check

Open tomeyro opened this issue 10 years ago • 2 comments

It would be nice if you added an option to disable the cache check. We are attaching a custom param to the url in some request to avoid getting the cached response, but angular-loading-bar still recognizes the request as cached.

tomeyro avatar Sep 18 '14 21:09 tomeyro

Custom param? You mean an additional param to the $http config object or adding a query string param to the url? Adding a randomized query string param should definitely work.

As far as programatically handling this as part of the library, I'm happy to take a PR, but I'm not in need of something like this myself.

chieffancypants avatar Sep 21 '14 22:09 chieffancypants

angular-loading-bar checks the cache using config.url

var cached = cache !== undefined ?
          cache.get(config.url) !== undefined : false;

angular caches responses using both config.url and config.params

var url = buildUrl(config.url, config.params);
if (cache) {
        cachedResp = cache.get(url);

The buildUrl function is not part of the public api, but there is an open issue for this https://github.com/angular/angular.js/issues/7429

ryanhart2 avatar Nov 28 '14 16:11 ryanhart2