Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ngCacheBuster
✓ angular.module('myApp', ['ngCacheBuster']);
✗ <script src='angular-cache-buster.js'></script>
Import by adding module dependency (module name is 'ngCacheBuster'). Does not export a symbol.
httpRequestInterceptorCacheBusterProvider
✓ angular.module('myApp').config(function(httpRequestInterceptorCacheBusterProvider) { ... });
✗ angular.module('myApp').config(['httpRequestInterceptorCacheBusterProvider', ...]);
Provider is injected inside config block; name is 'httpRequestInterceptorCacheBusterProvider'.
setMatchlist
✓ httpRequestInterceptorCacheBusterProvider.setMatchlist([/.*partials.*/]);
✗ httpRequestInterceptorCacheBusterProvider.setMatchlist('/.*partials.*/');
Accepts array of RegExp objects or strings; second optional boolean argument 'true' for blacklist mode.
Complete setup: install Bower package, add module dependency, configure optional whitelist/blacklist, and use $http without modifying URLs.
// 1. Install: bower install angular-cache-buster --save
// 2. Include script: <script src="bower_components/angular-cache-buster/angular-cache-buster.js"></script>
// 3. Add module dependency
angular.module('myApp', ['ngCacheBuster'])
// 4. Configure (optional): bust everything except /api/cached
.config(function(httpRequestInterceptorCacheBusterProvider) {
httpRequestInterceptorCacheBusterProvider.setMatchlist([/\/api\/cached.*/]);
})
// 5. Use $http normally – cache-busting query param '?cacheBuster=...' added automatically
.controller('MyCtrl', function($http) {
$http.get('/api/users').then(function(response) {
console.log(response.data);
});
});
Errors
Common errors & fixes
Error: [$injector:modulerr] Failed to instantiate module myApp due to: Error: [$injector:modulerr] Failed to instantiate module ngCacheBuster due to: Error: [$injector:nomod] Module 'ngCacheBuster' is not available!
Script file not loaded before Angular tries to bootstrap module.
fixEnsure <script src='angular-cache-buster.js'></script> is included after angular.js.
Error: httpRequestInterceptorCacheBusterProvider.setMatchlist is not a function
Provider is not injected correctly. Config function must use the provider's name exactly.
fixUse config(function(httpRequestInterceptorCacheBusterProvider) { ... }) and pass no parameters to the provider. GET /api/users?cacheBuster=1234567890 404 (Not Found)
Server does not ignore extra query parameters; rejects request due to unknown parameter.
fixConfigure server to ignore query parameter, or adjust matchlist to avoid busting that endpoint.
Error: [$http:cachebust] Unexpected interceptor
AngularCacheBuster version mismatch or duplicate interceptors.
fixEnsure only one instance of angular-cache-buster is loaded and that it is compatible with the AngularJS version.
Audit
Dependencies
No dependency data recorded yet.