ocLazyLoad
ocLazyLoad copied to clipboard
Add cacheBuster option
This PRs moves the cacheBuster function to a configurable option. That way you can manage how the urls are generated and thus the cache invalidated, e.g:
angular
.module('app', [
'oc.lazyLoad',
])
.config([
'$ocLazyLoadProvider',
function ($ocLazyLoadProvider) {
$ocLazyLoadProvider.config({
cacheBuster: function (url) {
// this is just an example and will not work for urls
// that already have query parameters
return url + '?_cache=' + window.assetsVersion;
}
});
}
]);
Related to #306
Note: the cacheBuster is used only when the cache option is set to false, which is a per file option. If you want to set cache to false for every modules, have at look at #335
Historically, some loaders weren't using the cacheBuster so I am adding them one by one as I'm needing them. Let me know if I've missed one that's useful to you.
When change is merge with master branch? I really need it.
@luismatesanz I am afraid this PR is not going to be merged any time soon. If you really need it, you can install this fork via: npm install wizbii/ocLazyLoad#merge
Up! :D
We need it.