grunt-cache-bust
grunt-cache-bust copied to clipboard
Added support for lazy loading
Adding support for lazy loading, this is already done in this fork of you branch. I am using the same fork in lot may projects in production environments with and without lazy load. Thought, to create a PR for it. :)
Thanks for the PR. I'll have a look at merging this later. FYI, the next version of the plugin (currently the beta version on npm) will remove the need for adding filters to allow this to happen. You can take a look at what's changed in #147 or by changing to that branch and reading the README
I'm slightly confused — what exactly does it do?
@ArmorDarks A lot of times we use lazyloading of images, some common approaches are like using lazy class or data-original. I added support so that we can cache bust these implementations as well.
@bhaskarmelkani Ah, I see. So how exactly does it work? I can't check the code, probably because of rebasing whole PR has been messed up and it's hard to read changes now...
So it just scans data
attributes too?
@ArmorDarks Yeah, but its been very long since I updated it. And it working perfectly fine some of my production systems. May be I will rebase the PR.
May be I will rebase the PR.
I think it would be wise to do so, otherwise it's very hard to review it.
Yeah, but its been very long since I updated it. And it working perfectly fine some of my production systems.
I just wanted to know how exactly it finds which data
attributes have to be processed too.
@ArmorDarks It looks like the whole implementation is changed now, the support for filters is removed.
Yeap, as @hollandben mentioned above.
Though, I think general idea of this PR is great, since it's indeed would be cool if lazyloaded images would be cachebusted too. However, maybe we should add config to state data
attributes which should be cachebusted explicitly? Otherwise I have feeling that we might end up in awkward situation when something like data-example-image-name='image.jpg'
will be cachebusted by accident too just because of similar name, while you wanted to put inside only example of name.
Yeah makes sense, maybe I will update the new implementation